如何在SQL select语句中使用autonumber数据库列

时间:2017-04-27 16:40:54

标签: c# sql ms-access

我无法从MS Access数据库中选择自动编号列,因为我一直收到此错误:

  

标准表达式中的数据类型不匹配

我根本不知道应该在我的SQL语句中添加什么类型(int,string,double,long ...)以匹配自动编号列?

PS:我是初学者

这是我的代码:

    string d = (string)Session["gouser"];
    string b = (string)Session["profile"];
    string s = (string)Session["stanum"];  // this is the auto number and its taken as a string 
    int y = 0;
    Int32.TryParse(s, out y);

    double X = y;

    DataTable m;

    m = DAL.SelectFromTable(" Select * FROM [Status] WHERE [user]='" + b + "' AND [number]='" + X + "'");

0 个答案:

没有答案