Failed to enable constraints

While working with a Web application this evening I ran into this error: "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints". 

As I  researched the origin of the error I found a lot of people having the same issue, and no real great solutions, however there was a lot of people pointing to the database properties itself, some thought it was the enable constraints set on the dataset in the code-behind.

After researching further I was pointed towards by Datasets in my .xsd file.  This file contains the duplicate copies of the field length values that were set when you created the table adapter.  I had changed a few of those values in the database after creating the table adapters in my project. 

You can reset these values by selecting your the column in your tableadapter and open it's properties where you can set the max length.

Posted on 8/10/2008 12:07:00 AM by Kyle P. Johnson

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: ASP.net

Comments are closed
Blog Flux Directory Blog Catalog