Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Rows and Constraints
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00819978
Message ID:
00820327
Vues:
22
>Sounds like you need to have an "Unknown" defination in your parent tables. We added a record ID=0 into our CODE table as a UNKNOWN code so all the FK field can have a default value of 0. As long as the business logic knows 0 means undefine, it can handle it correctly.

Well, I actually have some code that goes through the row and seeds default values so that's already the case.

The problem is that if you do this with a PK value the Row knows that it's a PK. If you add two records this way you have a PK rule violation because it's not unique. I've tried to work around this a number of ways, but I can't see a good way to do this generically. THe issue for the most part is that this happens in the guts of the generic business object layer. The value will always be assigned before a save, but right at creation and at addition to the rows collection there may be nothing in the row.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform