string connstr = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” + “info.mdb”;
OleDbConnection conn = new OleDbConnection(connstr);
conn.Open();
string str = “update 批次表 set 能否在库=”0″ where 批次ID=””+comboBox1.Text+”””;
OleDbCommand cmd = new OleDbCommand(str, conn);
cmd.ExecuteNonQuery();
conn.Close();
OleDbConnection conn = new OleDbConnection(connstr);
conn.Open();
string str = “update 批次表 set 能否在库=”0″ where 批次ID=””+comboBox1.Text+”””;
OleDbCommand cmd = new OleDbCommand(str, conn);
cmd.ExecuteNonQuery();
conn.Close();
解决方案
40
假如你的字段为数字类型,就把单引号去掉例如你的《能否在库》这个字段是数字类型,那你sql语句就是如下
string connstr = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” + “info.mdb”;
OleDbConnection conn = new OleDbConnection(connstr);
conn.Open();
string str = “update 批次表 set 能否在库=0 where 批次ID=””+comboBox1.Text+”””;
OleDbCommand cmd = new OleDbCommand(str, conn);
cmd.ExecuteNonQuery();
conn.Close();
更多
0
分享到:
string connstr = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=” + “info.mdb”;
OleDbConnection conn = new OleDbConnection(connstr);
conn.Open();
string str = “update 批次表 set 能否在库=0 where 批次ID=””+comboBox1.Text+”””;
OleDbCommand cmd = new OleDbCommand(str, conn);
cmd.ExecuteNonQuery();
conn.Close();
更多
0
分享到: