要更新一下access2007,结果总是提示update语句错误,感觉应该没错呀,大家帮忙看看,是哪出问题了
OleDbCommand command2 = new OleDbCommand(("UPDATE user SET password=@password WHERE name=@name"),conn);
command2.Parameters.Add("@password", OleDbType.Char);
command2.Parameters["@password"].Value = Nowpwd ;
command2.Parameters .Add("@name", OleDbType.Char);
command2.Parameters["@name"].Value = username;
if (command2.ExecuteNonQuery ()> 0)
{
ClientScript.RegisterStartupScript(this.GetType(), "修改成功", "<script language='javascript'>alert('密码已重置')</script>");
}
else
ClientScript.RegisterStartupScript(this.GetType(), "对不起,操作出现错误", "<script language='javascript'>alert('操作失误,请重新操作')</script>");
LEATH