Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Failed to enable constraints
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Failed to enable constraints
Miscellaneous
Thread ID:
01118876
Message ID:
01118876
Views:
39
Hi I have a parent->child form.

Here's the data:
Parent
======

id     Name
---    ----
P1     Rick
P2     Chris

Child
=====

ParentId   CategoryCode  Sequence
--------   ------------  --------
P1         C1            1
P1         C1            2
P1         C2            3
P2         C3            4
 
The child table doesnt have a primary key. In addition, as you can see, the child table has duplicate category codes within the same parent id.

In the child bizobj, I set PrimaryKey to "" (since there's no PK). The child data is not going to be modified. I register the child bizobj as a child of the parent. When I navigate to parent P1, I get the following error "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."

The data is sql server, there is a non-unique index on the ParentId field.

I have tried setting

this.PrimaryKeys = new string[] {"ParentId", "CategoryCode","Sequence"};

figuring this might work but I get the same error -

Any ideas?
TIA,
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Next
Reply
Map
View

Click here to load this message in the networking platform