请高手帮忙解答一下,语句在access中执行正常,在button下就出问题了。
private void button2_Click(object sender, EventArgs e) { OleDbConnection Conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\172.16.1.13\data$\att2000.mdb"); string SqlStr = "update userinfo set password = "11" where ssb = "30116""; try { Conn.Open(); OleDbCommand Comm = new OleDbCommand(SqlStr,Conn); //MessageBox.Show(SqlStr); Comm.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { Conn.Close(); } }
解决方案
20
password是关键字,加方括号 [password]