Hello:
I would like to commit changes to the database, if any, when the row changes.
I was issuing a dataset.Update() on the BeforeRowDeactivate event. But if some of the data integrity rules is not obeyed (for example, first name cannot be null), it throws an exception.
So, is there another event that I can use to implement this requirement?
Venki
It sounds like the problem is not knowing when to update, but how to enforce your data integrity rules. You can set the AllowDbNull property on the DataColumn to false so that an error will be raised when the user tries to exit edit mode on that cell with a null value. You can also handle BeforeExitEditMode an enforce any kind of rule you like, setting the Cancel property of the event args to true if some criteria is not met.
Brian:
I am quite happy that the integrity rules are getting fired.
My question is what event I should use to commit the newly added row to the database?