Validating date

This action automatically creates an Column Changing or Row Changing event handler.For more information, see How to: Validate Data During Column Changes or How to: Validate Data During Row Changes.The event you choose depends on how granular you want the validation to be.If it's important that you catch an error immediately when a column changes, build validation by using the Column Changing event.When records are updated, the Data Table object raises events that you can respond to as changes are occurring and after changes are made.If your application uses a typed dataset, you can create strongly typed event handlers.Note supplied date format and date string go hand in hand.

You can confirm that data that's being written to a dataset is valid by building validation checks into the dataset itself.Otherwise, use the Row Changing event, which might result in catching several errors at once.Additionally, if your data is structured so that the value of one column is validated based on the contents of another column, then perform your validation during the Row Changing event.The first is the Column Changing and Column Changed events for the specific column that's being changed. If multiple changes are being made to the row, the events will be raised for each change.The data row's Begin Edit method turns off the Row Changing and Row Changed events after each individual column change.

Leave a Reply