Home All Groups Group Topic Archive Search About

3 different sqldatasource insert queries in 1 transaction...?

Author
5 Oct 2006 11:54 AM
Jan
Hi ,

In the asp.net application I am working on we use 3 different sqldatasource
objects with each a insert command in it.

I call:
  sqldatasource1.Insert();
  sqldatasource2.Insert();
  sqldatasource3.Insert();

what i want is wrap these three inserts in 1 transaction.
I ve found solutions where only one insert is in the transaction
(http://windowssdk.msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasourcecommandeventargs.aspx).

How can this be solved..?

Author
5 Oct 2006 12:24 PM
Miha Markic [MVP C#]
Use brand new System.Transactions.Transaction class.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"Jan" <J**@discussions.microsoft.com> wrote in message
news:CADE0735-80E5-43B8-B339-E8D7B3E27F08@microsoft.com...
> Hi ,
>
> In the asp.net application I am working on we use 3 different
> sqldatasource
> objects with each a insert command in it.
>
> I call:
>  sqldatasource1.Insert();
>  sqldatasource2.Insert();
>  sqldatasource3.Insert();
>
> what i want is wrap these three inserts in 1 transaction.
> I ve found solutions where only one insert is in the transaction
> (http://windowssdk.msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasourcecommandeventargs.aspx).
>
> How can this be solved..?

AddThis Social Bookmark Button