c#连接数据库的问题..
想实现.连接数据库,在DataGrid中显示出来的功能.
不知道错那了..
主要程序..
this.dbConn.ConnectionString = "workstation id=TOTTI;packet size=4096;user id=sa;data source=TOTTI;persist securi" +"ty info=False;initial catalog=Tour DataBase";
private void sureButton_Click(object sender, System.EventArgs e)
{
dbConn.Open();//打开数据库连接
this.dbComm=new System.Data.SqlClient.SqlCommand(mySQL,dbConn);
this.dbAdap = new System.Data.SqlClient.SqlDataAdapter();
this.dbDS = new System.Data.DataSet();
dbAdap.SelectCommand=dbComm;
dbDS.Clear();
dbAdap.Fill(dbDS);
}