I have 3 different tables in my database as below;
Table 1:
ResourceID | ResourceTitle| ResourceCategory
Table 2:
DocumentID| DocName | DocSize
Table 3:
ResourceID | DocumentID
Now I want to add some values into the above tables (using a C# .ASP.NET) respectively.
- The first table I have one row to be added into the Resource table(Table 1).
- The second table I have multiple rows to be added into the document table(Table 2).
- The third table needs to keep all the ids from the first two tables as a foreign key in ResourceDocument Table(Table 3).
All of the processes need to be done in one single transaction, so there would be a loop for the second table data in my asp.net c# class.
the problem that I have is finding the right way to handle the transaction to do this job, also I need to make sure while these processes are running it doesn't let the other users to modify these data.
Your help would be appreciated.