How to insert data in two dependent table through one query in C#
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Mar 31, 2011, 5:09 AM EDT
for eg:
cmd.CommandText = "Insert into table1 (column1) values (@column1); Insert into table2 (column1) values (@column1);";
matt cupryk25 reputationPosted Apr 8, 2011, 9:36 AM EDT