private void bSave_Click(object sender, EventArgs e) { if (dbobj == null) { bSave.Enabled = false; } try { cctr.SaveRelation(dbobj); MessageBox.Show("Saving returned Successfully ", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); dbobj = null; bSave.Enabled = false; } catch (Exception ex) { MessageBox.Show("Error occured during save \n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }