作者在 2007-05-17 19:25:00 发布以下内容
SqlConnection con = new SqlConnection("server = .; uid = sa; pwd= sa; database = TY_Action");
con.Open();
string Temp=null;
Temp+="update TY_User set UserPassword='{0}' where UserName="+"'"+name+"'";
string sql=string.Format(Temp,this.textNewPassword.Text);
SqlCommand com=new SqlCommand(sql,con);
com.ExecuteNonQuery();
con.Close();
MessageBox.Show("修改密码成功","提示");