Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for unique values
Message
De
11/08/2008 11:49:13
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01337135
Message ID:
01338057
Vues:
20
Hi Linda,

>Tim,
>
>Okay, I finally figured out the problem, with some help from Josh Horne at OakLeaf. The error was occurring because the code I was testing for uniqueness was the primary key. I was trying to avoid having an auto-assigned key and a user-selected key. As it turns out, the primary key test is checked before the rules are checked. I have now changed the table structure to have an auto-assigned integer key and a separate, user-assigned code and the rule for uniqueness works fine. Many thanks to you for all your help with this. Thanks, also, to Bob and Maurizio.
>

That is a good piece of information to tuck away for future. As a matter of rule of my own I always create surrogate keys. If the user needs a code of somekind it it seperate from the PK surrogate key. I didn't realize the framework checked this prior to the rules so good to know.
Glad you got it figured out.
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform