Validating Data

Before persisting a data record to the database, you must validate the data contained in its fields. You may need to validate the value in a field of a data record independently. You may also need to validate the values of any number of fields based on the values of other fields of the same data record. If the validation fails, you must cancel the update of the data record and provide clear error messaging to the user.

In this chapter, you will learn how to use the FieldVerifying and RowUpdating event handlers to implement data validation.