I am working on a small project where there are 2 table
Table 1 : TransactionMaster
Table 2 : TransactionDetail
I have a page where the user selects customer and product and then adds quantity, price and clicks on Add.
After clicking on Add the data is stored in data table which is dynamically created and then the data table is stored in session,
The data table which is stored in session is used as a data source to bind it to grid view.
The same the user will add multiple products. After adding all products the user will click on Save. On the save event the data table stored in session and other records stored in textbox will be saved to sql table.
My worry is that if multiple user are using the page the bill number shouldn't be duplicated and the bill number should be same in the master and detail table but duplication should not happen.
So should i insert the data first in master table or detail table and how to get the Invoice number to be same for both table for the master and detail transaction.
Thanks and regards