OleDbConnection con = new OleDbConnection(conStr);
        string sql = "delete from Admins where ID = '" + id + "'";
        OleDbCommand cmd = new OleDbCommand(sql, con);        if (con.State == 0)
            con.Open();        bool result;
        if (cmd.ExecuteNonQuery() > 0)   总是对这有提示:标准表达式中数据类型不匹配。
            result = true;
        else
            result = false;请求高人帮忙

解决方案 »

  1.   

    cmd.ExecuteNonQuery() 执行的是delete  
    怎么能和0比较呢 
     if (cmd.ExecuteNonQuery())试试
      

  2.   

    cmd.ExecuteNonQuery() 这个根本不行,这个执行无返回值怎么和0比较啊!
      

  3.   


    这个函数的返回值不是int型的么
      

  4.   

    delete from Admins where ID = '" + id + "'
    你这个ID是什么类型的,数字类型的话就把引号去掉
    "delete from Admins where ID =" +id.Trim();
      

  5.   

    id的字段类型,在access 如果id类型为数字,那么就不能存在''
    string sql = "delete from Admins where ID = " + id + "";