Thursday, October 21, 2010

How to prevent duplicate id while inserting multi-records at the same time within network, using VB.NET?

Hi everyone,



In my problem, my application is going to generate new record id itself, and i want to prevent new id duplication while network users insert records at the same time. Anyways, m using VB.NET and SQL Server. Pls help...



Thx in advanceHow to prevent duplicate id while inserting multi-records at the same time within network, using VB.NET?
First question I have to ask is ';Why and how does the app generate it's own ID';???

However working on the basis you know what you're doing then you could use a combination of the clients IP address (or login if available), date and time (to millisecond) this should ensure that no-one else will be trying to insert the same ID.How to prevent duplicate id while inserting multi-records at the same time within network, using VB.NET?
That's just bad database design. Set your identity column to auto increment.

No comments:

Post a Comment