Hi,
I have a web application in which I have a page named 'Data'. Many people will try to insert data into the table at a given time. So the reference no other than the primary key will get duplicated which should not be permitted. For inserting the data into the DB table, I am using a stored procedure in SQL. In my vb.net web application I am using Business layer with enterprise library for calling the stored procedure. Now I want to lock the table for inserting so that when multiple users insert, there won't be any complications. How can I do this? Please advise.
I didn't mean the primary key. I have a primary key field namely InvoiceID which is not duplicated. But along with that I need an 'InvoiceNo' which should not be duplicated as well. This is automatically populated from the previously entered 'InvoiceNo'+1 which will be duplicated when multiple users try to insert at the same time.
Regards