日期:2014-05-17  浏览次数:20723 次

UPDATE 语句的语法错误 c#
upadte 那条语句不知道错在哪里,郁闷了好久,求大神们解答啊。


string MD5passwd1;

MD5passwd1 = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password1.Text, "MD5");

OleDbCommand upadte_cmd = new OleDbCommand("UPDATE [bin_manage] set [password] ='" + MD5passwd1 + "', [email] ='" + email.Text + "', where [username] =" + username.Text, myConn);

upadte_cmd.ExecuteNonQuery();

myConn.Close();

Response.Write("<script>alert('ok');location='index.aspx';</script>");

------解决方案--------------------
where =" + username.Text这里要加单引号==》where = ‘" + username.Text +”’“
------解决方案--------------------
where 后面加单引号了吗?