为什么老是出错?请下面的代码有什么问题么?
string dbname;
dbname=Server.MapPath("kaohe.mdb");
OleDbConnection myConnection = new OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=" + dbname );
myConnection.Open();
DataSet ds = new DataSet();
OleDbDataAdapter adapter = new OleDbDataAdapter( "select name as 姓名,talkpxzpf as 总评分 FROM kaohe where pici like '"+TextBox1.Text.ToString()+"'", myConnection );
adapter.Fill(ds, "kaohe");
DataGrid1.DataSource = ds.Tables["kaohe"].DefaultView;
DataGrid1.DataBind();
myConnection.Close();
string dbname;
dbname=Server.MapPath("kaohe.mdb");
OleDbConnection myConnection = new OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=" + dbname );
myConnection.Open();
DataSet ds = new DataSet();
OleDbDataAdapter adapter = new OleDbDataAdapter( "select name as 姓名,talkpxzpf as 总评分 FROM kaohe where pici like '"+TextBox1.Text.ToString()+"'", myConnection );
adapter.Fill(ds, "kaohe");
DataGrid1.DataSource = ds.Tables["kaohe"].DefaultView;
DataGrid1.DataBind();
myConnection.Close();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货