}
else
{
sqlConnect();
string sql = "select userpassword from usertable where userid = '" + label6.Text + "'";
SqlCommand cmd = new SqlCommand(sql, conn);
if (textBox2.Text != cmd.ExecuteScalar().ToString().Trim())
{
MessageBox.Show("原密码错误");
return;
}
else
{
string sq4 = "update usertable set userpassword='" + textBox3.Text.Trim() + "'where userid='" + label6.Text + "'";
SqlCommand cmd1 = new SqlCommand(sq4, conn);
cmd1.ExecuteNonQuery();
MessageBox.Show("修改成功");
sqlClose();
} } ASP.NET客户信息管理系统的开发(19):http://www.youerw.com/jisuanji/lunwen_460.html