Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for unique values
Message
From
11/08/2008 11:49:13
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01337135
Message ID:
01338057
Views:
21
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform