private void btn_Delete_Click(object sender, EventArgs e) { DialogResult dialog = MessageBox.Show("Are you sure?", "Delete Account", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialog == DialogResult.Yes) { string query = "DELETE from Users Where ID='" + SignIn.id + "'"; SqlCommand deleteCommand = new SqlCommand(query); int row = objDBAccess.executeQuery(deleteCommand); if (row == 1) { MessageBox.Show("Account information deleted successfully"); this.Hide(); SignIn sign = new SignIn(); sign.Show(); } else { MessageBox.Show("Error Occured..Try Again"); } } }