Datacon dataconn = new Datacon();什么意思

来源:百度知道 编辑:UC知道 时间:2024/05/25 08:13:13
看到后面有:dataconn.eccom("insert into tb_Student"
+"(ID,Name,PWD,question,answer,Sex,profession)"
+"values('" + this.txtStuID.Text + "','" + this.txtStuName.Text + "','"
+ this.txtStuPwd.Text + "','" + this.txtQuePwd.Text + "','"
+ this.txtAnsPwd.Text + "','" + this.ddlSex.Text + "','"
+ Request["DropDownList2"] + "')");

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Drawing.Text;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Text.RegularExpressions;

namespace SMS.BaseClass
{
class DataOperate
{
DataCon datacon = new DataCon();//声明DataCon类的一个对象,以调用其方法

来源:C#2005与SQL2000共同编写的库存管理系统 展示 DataOperate.cs源代码

如果 没有猜错的化 Datacon应该是一个 数据访问类
其中对数据库连接,数据操作进行了封装,在你的项目中 查看一下 Datacon类 如果是用的 vs系列ide的话 可以将鼠标停在Datacon上 右键选 转到定义,就能跳转到 Datacon类

从程序上看,Datacon是操作数据库的一个类,new就是实例化一个对象,为该对象分配实际内存空间

创建一个新的Datacon 对象