Failed to enable constraints

Was working on an older site connected via xsd/data sets to a legacy database. It started giving us this error:

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

That’s basically a big fat lie, as the database wouldn’t be suddenly violating key constraints. Nonsense. After some digging I determined that this error should actually read:

“The schema in the database has changed, but the xsd hasn’t been updated. Update your xsd with appropriate length on variable length columns.”

There, hope that helps!

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>