For more information, see Validate data in datasets.
For more information about suspending events, see Turn off constraints while filling a dataset.When you update a record in a dataset, there is the possibility of an error.To prevent premature constraint violations you can temporarily suspend update constraints.This serves two purposes: Note In Windows Forms, the data binding architecture that's built into the datagrid suspends constraint checking until focus moves out of a row, and you do not have to explicitly call the Begin Edit, End Edit, or Cancel Edit methods.The first step is to update the dataset with new records, changed records, or deleted records.
If your application never sends those changes back to the data source, then you are finished with the update.
In this situation, the Enforce Constraints property is set to .
After you complete an update, you can re-enable constraint checking, which also re-enables update events and raises them.
If you do send the changes back to the database, then a second step is required.
If you aren't using data-bound controls, then you have to manually call the Update method of the same Table Adapter (or data adapter) that you used to populate the dataset.
For example, you might inadvertently write data of the wrong type to a column, or data that's too long, or data that has some other integrity problem.