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;请求高人帮忙
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;请求高人帮忙
怎么能和0比较呢
if (cmd.ExecuteNonQuery())试试
这个函数的返回值不是int型的么
你这个ID是什么类型的,数字类型的话就把引号去掉
"delete from Admins where ID =" +id.Trim();
string sql = "delete from Admins where ID = " + id + "";