private void metroButton7_Click(object sender, EventArgs e) { p.sPID = Convert.ToInt32(sPID.Text); bool success = p.Delete(p); if (success == true) { MessageBox.Show("Subject Successfully Deleted."); } else { MessageBox.Show("error"); } DataTable dtp = p.Select(); metroGrid2.DataSource = dtp; Clear2(); }