MySqlConnection myConnection1 = new MySqlConnection(login_Connection_String);
string myUpdateQuery = "UPDATE tb_user SET tb_user.Password = " + textBox_new_pwd.Text.ToString() + " WHERE tb_user.User_ID = '" + textBox_login_name.Text.ToString() + "'" ;
// string myDelQuery = "DELETE FROM tb_user WHERE tb_user.User_ID = " + textBox_login_name.Text;
// string myInsQuery = "INSERT (" + textBox_new_pwd.Text +","+ textBox_login_name.Text + ") into tb_user";
MySqlCommand myUpdateCommand = new MySqlCommand(myUpdateQuery, myConnection1);
//修改tb_user 中对应User_ID的密码
myUpdateCommand.Connection.Open();
myUpdateCommand.ExecuteNonQuery();
myUpdateCommand.Connection.Close();
MessageBox.Show("修改密码成功!");
string myUpdateQuery = "UPDATE tb_user SET tb_user.Password = " + textBox_new_pwd.Text.ToString() + " WHERE tb_user.User_ID = '" + textBox_login_name.Text.ToString() + "'" ;
// string myDelQuery = "DELETE FROM tb_user WHERE tb_user.User_ID = " + textBox_login_name.Text;
// string myInsQuery = "INSERT (" + textBox_new_pwd.Text +","+ textBox_login_name.Text + ") into tb_user";
MySqlCommand myUpdateCommand = new MySqlCommand(myUpdateQuery, myConnection1);
//修改tb_user 中对应User_ID的密码
myUpdateCommand.Connection.Open();
myUpdateCommand.ExecuteNonQuery();
myUpdateCommand.Connection.Close();
MessageBox.Show("修改密码成功!");