I am creating a multi-user application based on SQL server and VB.NET I am adding new row to table and then query to get the new id because its auto generated
insert in transactions
and then I get the new ID in anther query
select Top 1 transaction_ID from Transactions .....
and use this id to insert rows in anther table called TransactionDetails
this is safe in single user application. but in multiuser application I might get the wrong transaction_ID if anther user add anther transaction.
What is the best way to handle that? Thank you,