R
RA
Hi
I use Sql 7 for the db.
I have asp.net apps which collocts online transactions.
I have customers, orders, orderdetails.. tables.
I have a DataSet for each table and I change the dataset based on the info
from the user.
Squence: Add to Customers dataset, Add to orders dataset and add to
orderdetails datase. If all is ok then I call each dataset adapter update
method..
In order to fill the order table I need to get the CustomerId - This I am
getting my retreiving the Max(CustomerId) from the Customers table.
My question is that if lets say 200 new customers try to add their
information to the web site, and since for each one of them I use the
Max(CustomerId) to get the new customerId, it is possible that multiple
users will get the same CustomerId, this is because I only updates the
database after the new order and order detail has been processed. What
should I do to avoid this? I don't want to enter a new Customer if for
example the order orderdetails dataset addrow method fails. Thats why I am
wating until I add the rows to all tables.
Thenka,
Ron
I use Sql 7 for the db.
I have asp.net apps which collocts online transactions.
I have customers, orders, orderdetails.. tables.
I have a DataSet for each table and I change the dataset based on the info
from the user.
Squence: Add to Customers dataset, Add to orders dataset and add to
orderdetails datase. If all is ok then I call each dataset adapter update
method..
In order to fill the order table I need to get the CustomerId - This I am
getting my retreiving the Max(CustomerId) from the Customers table.
My question is that if lets say 200 new customers try to add their
information to the web site, and since for each one of them I use the
Max(CustomerId) to get the new customerId, it is possible that multiple
users will get the same CustomerId, this is because I only updates the
database after the new order and order detail has been processed. What
should I do to avoid this? I don't want to enter a new Customer if for
example the order orderdetails dataset addrow method fails. Thats why I am
wating until I add the rows to all tables.
Thenka,
Ron