Failed to enable contraints...

concise

Member
Joined
Jan 28, 2003
Messages
5
Im getting this error...

"Failed to enable contraints. One or more rows contains values violating non-null, unique, or foreign key constraints."

Heres my setup. Ive got a few tables, User, Room, Building, Company...

Every Table has a Primary key ID column that is an integer.

In my dataset, the User.UserID column is referenced [via relationships in the XML Designer] by at least 3 tables [and 9 subsequent columns]. These relationships work fine, the dataset fills fine, exceptions get thrown in the right places, I can catch them, all that good stuff.

(ex. User.UserID referenced by Building.Administrator)

As soon as I add a relationship to a table that is referencing another table, the dataset fails to fill, and the "Failed.." exception is thrown.

(ex. Building.BuildingID referenced by User.Building)

Now, of course, I checked multiple times that the data I have isnt violating the constraint that I just added. So thats not the cause...

What is going on? Can I not have one table [foreign] that is referencing another table [primary], be referenced by another table with another different primary/foreign relationship?

TIA.

[.xsd attached]

p.s. Is it something to do with the way the XML is generated? Every primary key built after the first, in turn references this first primary key generated. Does that cause some recursive definitions?
 

Attachments

err...

Hmm... the whole point of having constraints in the first place was so I could enforce referential integrity in my data.

Disabling the contraints would mean that no exceptions get thrown when a user action violates those integrity relations.

I just dont think the relationships are working as they should ... as I described in detail above.

Any more ideas?

Thanks.
 
Back
Top