private void buttonDeleteUser_Click(object sender, EventArgs e) { if (textBoxEditUserSearch.Text == "") { MessageBox.Show("Please fill the required information", "Error"); } else { try { DBL.User user = new DBL.User(); user.Username1 = textBoxEditUserSearch.Text; user.deleteUser(user); MessageBox.Show("Deleted Well", "Success"); allUserTable(); textBoxEditUserSearch.Text = ""; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } } }