Validation within a dataset can be accomplished:
There are several events that are raised by the DataTable object when a change is occurring in a record:
By default, each change to a column therefore raises four events: first the ColumnChanging and ColumnChanged events for the specific column being changed, and then the RowChanging and RowChanged event. If multiple changes are being made to the row, the events will be raised for each change.
The event you choose depends on how granular you want the validation to be. If it is important that you catch an error immediately when a column is changed, build validation using the ColumnChanging event. Otherwise, use the RowChanging event, which might result in catching several errors at once. Additionally, if your data is structured in such a way that the value of one column is validated based on the contents of another column, then you should perform your validation during the RowChanging event.
When records are updated, the DataTable object raises events that you can respond to as changes are occurring and after changes are made.
If your application is using a typed dataset, you can create strongly typed event handlers. This will add four additional typed events that you can create handlers for; dataTableNameRowChanging, dataTableNameRowChanged, dataTableNameRowDeleting, and dataTableNameRowDeleted. These typed event handlers pass an argument that includes the column names of your table that make code that easier to write and read.