Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disallowing duplicate values
Message
De
05/03/2010 08:04:00
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Disallowing duplicate values
Divers
Thread ID:
01452754
Message ID:
01452754
Vues:
75
Hi,

I want to disallow duplicate values from being entered. For example, I have a table of Countries where I do not want duplicate country names. I have set a UNIQUE constraint on the Country Name field in SQL Server, but the UI did not automatically pick this up. Should it?

I then found some sample code in the Developer's Guide which does a dynamic SQL select to check for duplicates and this code is called as one of the business rules. My thinking is that if the timing is perfect, two people could run this code at the exact same time and the rule will not detect duplicates so the users will then get an error from SQL Server. I know this is highly unlikely, but it is possible.

What is the best way to handle this?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform