C# 程序走到da.Fill(ds);就抛异常,求大神指点!!!!!
stringconnstr,StrSQL;StrSQL="SELECT*FROMtable1WHEREcompanylast='"+this.comboBox1.Text...
string connstr, StrSQL;
StrSQL = "SELECT * FROM table1 WHERE companylast ='" + this.comboBox1.Text.Trim() +"'and Names = '" + this.comboBox2.Text.Trim() + "'";
// elect id from bbs_admin where UserName='" + uName + "' AND UserPassword = '" + uPwd + "'"
connstr = "provider=Microsoft.jet.oledb.4.0;data source=" + Application.StartupPath + "\\ykzdkhcj.mdb";
OleDbConnection conn1 = new OleDbConnection(connstr);
conn1.Open();
OleDbDataAdapter da = new OleDbDataAdapter(StrSQL, conn1);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable mytable = new DataTable();
mytable = ds.Tables[0]; 展开
StrSQL = "SELECT * FROM table1 WHERE companylast ='" + this.comboBox1.Text.Trim() +"'and Names = '" + this.comboBox2.Text.Trim() + "'";
// elect id from bbs_admin where UserName='" + uName + "' AND UserPassword = '" + uPwd + "'"
connstr = "provider=Microsoft.jet.oledb.4.0;data source=" + Application.StartupPath + "\\ykzdkhcj.mdb";
OleDbConnection conn1 = new OleDbConnection(connstr);
conn1.Open();
OleDbDataAdapter da = new OleDbDataAdapter(StrSQL, conn1);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable mytable = new DataTable();
mytable = ds.Tables[0]; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询