Click here to Skip to main content
15,921,382 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am having two tables t1,t2. I want to insert into these two tables using a stored procedure and sqldataadapter. Is it possible to insert using single dataadapter and also batch update (da.update) using same dataadapter?. If it is possible please tell me how to do that?

Thanks in advance.
Posted

1 solution

Yes, you can use the stored procedure to handle the insertions to two different tables and call it using data adapter. For example, see: Modifying Data with Stored Procedures (ADO.NET)[^].
 
Share this answer
 
Comments
Mohamed Mitwalli 14-May-12 1:15am    
5+
vikas.pawar143 14-May-12 1:23am    
But actually i want batch update on these two tables, so normal insert using dataadapter will not work. Is there any need of tableMapping?
Wendelius 14-May-12 14:16pm    
You're correct, using a normal insert statement this isn't feasible. But Why would you need to insert to two tables at the same time. I'm guessing that the problem is actually something else.

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