C#连接ACCESS数据库的程序中出现"标准表达式中数据类型不匹配。"怎么处理?
代码如下:inta=this.dataGrid1.CurrentCell.RowNumber;stringmystr="Provider=Microsoft.Jet.OL...
代码如下:
int a = this.dataGrid1.CurrentCell.RowNumber ;
string mystr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\\book.mdb";
OleDbConnection myconn = new OleDbConnection(mystr);
myconn.Open();
string mycom = "delete from pass where xh=";
mycom += this.myset.Tables [0].Rows[a][0];
OleDbCommand com = new OleDbCommand(mycom,myconn);
com.ExecuteNonQuery();
OleDbDataAdapter myda = new OleDbDataAdapter("select * from pass order by xh",myconn);
this.myset.Clear();
myda.Fill(myset,"pass");
myconn.Close(); 展开
int a = this.dataGrid1.CurrentCell.RowNumber ;
string mystr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\\book.mdb";
OleDbConnection myconn = new OleDbConnection(mystr);
myconn.Open();
string mycom = "delete from pass where xh=";
mycom += this.myset.Tables [0].Rows[a][0];
OleDbCommand com = new OleDbCommand(mycom,myconn);
com.ExecuteNonQuery();
OleDbDataAdapter myda = new OleDbDataAdapter("select * from pass order by xh",myconn);
this.myset.Clear();
myda.Fill(myset,"pass");
myconn.Close(); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询