Rasal doss Solomon wrote:
I wish to generate a sequence number in vb.net 1.1 based on the record count of a table.If more than one user want to create sequence number as abobe by accesing the same database and table concurrently, the table should be locked for the second user till the sequence number for the first user is created .
What happens if data is deleted? You will end up with rows with the same sequence number. The efficient way of doing this is to make column an IDENTITY column that starts at 1 with an increment of 1. If you delete data, however, it will no longer be based on the number of rows as it is based on an increment since the last insert.
Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website