Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. string connect = "server=localhost;username=root;database=users;password=;";
  4. MySqlConnection connection = new MySqlConnection(connect);
  5. connection.Open();
  6. string zapros = "SELECT email FROM users.data WHERE email='" + textBox1.Text + "'";
  7. string updatepassword = "UPDATE `users`.`data` SET `password`='1122334455' WHERE `email`='" + textBox1.Text + "';";
  8. MySqlCommand command = new MySqlCommand(zapros, connection);
  9. MySqlCommand command1 = new MySqlCommand(updatepassword, connection);
  10. try
  11. {
  12. string resul = command.ExecuteScalar().ToString();
  13. string updpass = command1.ExecuteScalar().ToString();
  14.  
  15. }
  16. catch (Exception ex)
  17. {
  18. MessageBox.Show("Такого нет!");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement