Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Failed to enable constraints
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Failed to enable constraints
Divers
Thread ID:
01118876
Message ID:
01118876
Vues:
38
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform