private void btnOK_Click(object sender, EventArgs e) { try { db.SubmitChanges(); } catch (Exception) { MessageBox.Show("Co van de"); } }
private void button1_Click(object sender, EventArgs e) { try { db.SubmitChanges(); this.DialogResult = DialogResult.OK; } catch (Exception) { MessageBox.Show("Co loi!"); } }