Asp.net连接Access数据库数据类型问题

出现的问题 
  在修改页面获取文章ID时候
  程序中断,提示在执行类时数据类型不匹配,仔细思考了一下,可能是数据库Access的ID 是自增编号,是数字类型的
  不能在id上面在加'"+ID+"'
string cmdtext = "select * from tb_LeaveWord where ID='"+id+"'";
这句在SqlServer里面不会有错误的
后来在网上查了一下资料,确实也有出现过这样情况,以及access不能储存过程,我是初学者,讲的不好,把我遇到的问题写下来,
希望能对需要的人有帮助
解决方法
  把 string cmdtext=string cmdtext = string.Format("select * from tb_LeaveWord where ID={0}", id);
  问题解决

 /*----------------下面是代码--------*/
    int id = Convert.ToInt32(Request.QueryString["ID"].ToString());
    string cmdtext = string.Format("select * from tb_LeaveWord where ID={0}", id);
   oleData oledata = new oleData(); //oleData是自定义的处理Data的类 
       OleDbDataReader read = oledata.GetRead(cmdtext);
        if(read.Read())
        {
            ShowName = read["Uid"].ToString();
            ShowSubject = read["Subject"].ToString();
            ShowContent = read["Content"].ToString();
            ShowTime = read["DateTime"].ToString();
         }

原文地址:https://www.cnblogs.com/clc2008/p/1229294.html