Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try
- {
- string MyConnection2 = "datasource=localhost;port=3307;username=root;password=root";
- string Query = "delete from student.studentinfo where idStudentInfo= + this.IdTextBox.Text + ;";
- MySqlConnection MyConn2 = new MySqlConnection(MyConnection2);
- MySqlCommand MyCommand2 = new MySqlCommand(Query, MyConn2);
- MySqlDataReader MyReader2;
- MyConn2.Open();
- MyReader2 = MyCommand2.ExecuteReader();
- MessageBox.Show("Data Deleted");
- while (MyReader2.Read())
- {
- }
- MyConn2.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
Add Comment
Please, Sign In to add comment