我遇到UPDATE查询问题。
UPDATE
根本不更新数据库......
感觉command.ExecuteNonQuery()
没有发生。
以下是代码:
-- The Connection was opened before --
System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand();
command.Connection = connection;
command.CommandText = "UPDATE users SET user_name=@userName, pass_word=@pass, Uname=@Uname WHERE id=@id";
command.Parameters.AddWithValue("@id", theId);
command.Parameters.AddWithValue("@userName", userName);
command.Parameters.AddWithValue("@pass", pass);
command.Parameters.AddWithValue("@Uname", Uname);
command.ExecuteNonQuery();
Response.Redirect("~/profile.cshtml");
感谢您的帮助
Etay