Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have one table tblinvoice by which i got latest generated identity id via using scope identity keyword.

Now i want to use this scopeidentity value to insert multiple rows in others table with all records have same id(scope identity as foreign key).


any one tell me how it is possible in asp.net
Posted

1 solution

If I get it right, you are making SQL insert, you get back id and based on that id you want to insert other rows into another table?

just use SqlCommand to insert data.

if you have a lot of data you should think about batch operations.

you can also use SqlAdapter to synchronize data with your database.

if you want to know more about this topic
try for example this: Using ADO.NET for beginners[^]

or just google ADO.NET or c# SQL or somethink like this. If you have more specific question, just ask I will try to help :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900