ValidationException Class
Updated: July 2008
Represents the exception that occurs during validation of a data field when the ValidationAttribute class is used.
Assembly: System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)
A validation exception occurs if an input value does not match the expected data type, range or pattern of the data field. For example, validating an integer value in a data field that expects a DateTime value causes a validation exception. You can provide custom validation logic in a LINQ to SQL class to enforce validations.
This class uses the ValidationAttribute class to customize validations. A ValidationException is thrown if a validation error occurs. The exception is thrown when the Validate method is called. All the exceptions that are thrown during validation are contained in the InnerExceptions collection. You can retrieve each validation exception by iterating through the InnerExceptions collection.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.