I intend to insert into two different tables. Tables: Test and Test1. When creating I want to enter the test table id in the Test1 table. But the id is PK from the Test table.
I want create in simultaneously and pass this ID to other table, in this case Material_C.
For example: Table Material: I insert (ID: 3, name: 'xpto') Table Material_C: (ID: 1, idMaterial: 3, name:'example')
How can i make this using C# ?
CodePudding user response:
I have done same thing in SQL Server, I think you would be able to do same by taking reference in C#.
Here is the link- Store the value of output inserted._ID to local variable to reuse it in another query