Prior to sending changes to the database, the columns for each record in the resultsets are validated.


When validation fails, an Exception is thrown.


A validation error is an error that should not have happened in the first place.

In your code, make sure that all the columns values are set correctly prior to calling SaveChanges.

New record

The validator uses the modification flags to make sure all the updateable primary-key columns are set.


If not all primary-key columns are set, an Exception is thrown.

Existing record

When original-value tracking is enabled, the primary key values are guaranteed to be present, even with the modification flags set to false. There is nothing to validate.


When original-value tracking is disabled the validator uses the modification flags to make sure all updateable primary key columns are set.


If not all primary-key columns are set, an Exception is thrown.

Record marked for deletion

When original-value tracking is enabled, the primary key values are guaranteed to be present, even with the modification flags set to false. There is nothing to validate.


When original-value tracking is disabled the validator uses the modification flags to make sure all updateable primary key columns are set.


If not all primary-key columns are set, an Exception is thrown.


Also see topics updateable columns and modification tracking and original value tracking