Advertisement
Guest User

Untitled

a guest
May 5th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. private void btn_Update_Click(object sender, EventArgs e)
  2. {
  3. try
  4. {
  5. System.Data.DataTable dt2;
  6. dt2 = ds.Tables["tblForce_N"];
  7. this.assetdg.BindingContext[dt2].EndCurrentEdit();
  8. this.da.Update(dt2);
  9.  
  10. MessageBox.Show("Data Update successfull", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
  11. }
  12.  
  13. catch (SqlException ex)
  14. {
  15. MessageBox.Show(ex + "Update not Successfull", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
  16. }
  17. }
  18.  
  19. private void button1_Click(object sender, EventArgs e)
  20. {
  21. try
  22. {
  23. System.Data.DataTable dt2;
  24. dt2 = ds2.Tables["tblComp"];
  25. this.assetdg.BindingContext[dt2].EndCurrentEdit();
  26. this.da2.Update(dt2);
  27.  
  28. MessageBox.Show("Data Update successfull", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
  29. }
  30.  
  31. catch (SqlException ex)
  32. {
  33. MessageBox.Show(ex + "Update not Successfull", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement