Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
While developing windows base network application i got problem actually when two user creating records with same database it will accept duplicate record if i am using auto number field as record id so how can i avoid this problem....
Posted
Comments
Maciej Los 11-Jan-13 12:58pm    
We need more details...
Pradeep Shukla 11-Jan-13 13:04pm    
From question I guess it is related to the Db not with C#. More details needed.

Use Primary Key for validating data.It restricts the numbers to create duplicate values.
 
Share this answer
 
Auto numbering field does not protect you from logical duplicates. It just simply provides a new unique value for your record.

To enforce uniqueness for a set of columns you need to either create a unique constraint or index.

For the syntax for creating a unique index, have a look at CREATE INDEX Statement (Microsoft Access SQL)[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900