PrimeDigit – A Design Blog by Will Shaver

June 4, 2010

Failed to enable constraints

Filed under: Uncategorized — Will @ 9:43 am

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!

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress