private void CANCEL_Click(object sender, EventArgs e) { try { db.Update("true", "Constraints", "Seen", (constrains_details[0])); this.Close(); } catch (Exception exp) { MessageBox.Show("Colud not connect to sql"); } finally { if (db.isconnected == true) { db.CloseConnection(); } } }