Guest User

Untitled

a guest
May 3rd, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. try
  2. {
  3. string MyConnection2 = "datasource=localhost;port=3307;username=root;password=root";
  4. string Query = "delete from student.studentinfo where idStudentInfo= + this.IdTextBox.Text + ;";
  5. MySqlConnection MyConn2 = new MySqlConnection(MyConnection2);
  6. MySqlCommand MyCommand2 = new MySqlCommand(Query, MyConn2);
  7. MySqlDataReader MyReader2;
  8. MyConn2.Open();
  9. MyReader2 = MyCommand2.ExecuteReader();
  10. MessageBox.Show("Data Deleted");
  11. while (MyReader2.Read())
  12. {
  13. }
  14. MyConn2.Close();
  15. }
  16. catch (Exception ex)
  17. {
  18. MessageBox.Show(ex.Message);
  19. }
Add Comment
Please, Sign In to add comment