System.ComponentModel.DataAnnotations 4.0.0.0 System.Exception

A validation exception occurs if an input value does not match the expected data type, range or pattern of the data field. For example, if a user enters an integer value in a data field that expects a value, a validation exception occurs.

This class uses the class to customize validations. A is thrown if a validation error occurs. The exception is thrown when the method is called. All the exceptions that are thrown during validation are contained in the collection. You can retrieve each validation exception by iterating through the collection.

Represents the exception that occurs during validation of a data field when the class is used.

- Constructor
  4.0.0.0

  This method is the default constructor for the class.

  Initializes a new instance of the class using an error message generated by the system.

- Constructor
  4.0.0.0

  For more information about how to use this constructor, see How to: Customize Data Field Validation in the Data Model.

  Initializes a new instance of the class using a specified error message.

  A specified message that states the error.
- Constructor
  4.0.0.0

  This constructor is called during deserialization to reconstitute the exception object that is transmitted over a stream.

  Initializes a new instance of the class using serialized data.

  The object that holds the serialized data.
  Context information about the source or destination of the serialized object.
- Constructor
  4.0.0.0

  You typically will not use this constructor because validation exceptions are stored in the property, not .

  Initializes a new instance of the class using a specified error message and a collection of inner exception instances.

  The error message.
  The collection of validation exceptions.
- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class by using a validation result, a validation attribute, and the value of the current exception.

  The list of validation results.
  The attribute that caused the current exception.
  The value of the object that caused the attribute to trigger the validation error.
- Constructor
  4.0.0.0

  For more information, see How to: Customize Data Field Validation in the Data Model.

  Initializes a new instance of the class using a specified error message, a validation attribute, and the value of the current exception.

  The message that states the error.
  The attribute that caused the current exception.
  The value of the object that caused the attribute to trigger validation error.
- Property
  4.0.0.0
  System.ComponentModel.DataAnnotations.ValidationAttribute To be added.

  This type is used to enforce validation based on the metadata associated with the data table. If an error occurs, the class triggers a .

  This class can be overridden to create custom validation attributes.

  Gets the instance of the class that triggered this exception.

- Property
  4.0.0.0
  System.ComponentModel.DataAnnotations.ValidationResult To be added. To be added.

  Gets the instance that describes the validation error.

- Property
  4.0.0.0
  System.Object To be added. To be added.

  Gets the value of the object that causes the class to trigger this exception.