c#,在查询access数据库后,想把结果显示在datagridview中,就报错“标准表达式中数据类型不匹配”。
foreach(stringstrinindxelist){OleDbCommandcmd1=newOleDbCommand();cmd1.Connection=conn...
foreach(string str in indxelist) { OleDbCommand cmd1 = new OleDbCommand(); cmd1.Connection = conn; int i = Convert.ToInt32(str); cmd1.CommandText = string.Format("select doc_ID,doc from doc where doc_ID = '{0}'",i); OleDbDataAdapter adapter = new OleDbDataAdapter(); DataSet ds = new DataSet(); adapter.SelectCommand = cmd1; adapter.Fill(ds); this.dataGridView1.DataSource = ds.Tables[0]; }
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询