求助VS
if (textName.Text.Trim()==""||textPWD.Text.Trim()==""||textPWDNew.Text.Trim()==""||textPWDNew2.Text.Trim()=="")
MessageBox.Show("请填写完整信息!","提示");
else
{
oleConnection1.Open();
OleDbCommand cmd = new OleDbCommand("",oleConnection1);
string sql = "select * from userinfo where UName='"+textName.Text.Trim()+"' and PWD='"+textPWD.Text.Trim()+"'";
cmd.CommandText = sql;
if (null!=cmd.ExecuteScalar())
{
if (textPWDNew.Text.Trim()!=textPWDNew2.Text.Trim())
MessageBox.Show("两次密码输入不一致!","警告");
else
{
sql = "update userinfo set PWD='"+textPWDNew.Text.Trim()+"' where UName='"+textName.Text.Trim()+"'";
cmd.CommandText = sql;
cmd.ExecuteNonQuery();
MessageBox.Show("密码修改成功!","提示");
this.Close();
}
}
请问在VS2003中这段代码的意思是什么。请帮解释一下!!!!
------解决方案--------------------
先是对用户输入进行非空判断
然后去数据库中检验是否存在 此用户
如果存在则判断两次密码输入是否一致
如果一致 则更改用户密码