Guest User

Untitled

a guest
Nov 30th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. MySqlConnection connection = new MySqlConnection("Server=localhost;Port=3306; Database=brez-db;Uid=root;Pwd=root;");
  2.  
  3. try {
  4. connection.Open();
  5. String Query = "SELECT 1 FROM users_table WHERE user_Username='" + usernameTB.Text + "' AND user_Password='" + passwordTB.Password + "'";
  6. MySqlCommand myCommand = new MySqlCommand(Query, connection);
  7. MySqlDataReader myReader = myCommand.ExecuteReader();
  8.  
  9. while (myReader.Read())
  10. {
  11. String str = myReader.GetString("user_Username").ToString();
  12. MessageBox.Show(str);
  13. }
  14.  
  15.  
  16. }
  17. catch(Exception ex) { throw; }
  18. finally { }
  19.  
  20. while(myReader.Read()){}
Add Comment
Please, Sign In to add comment