L
lucius
I am trying to use a lightweight transaction to encapsulate multiple
sqlcommands on a connection (they update different databases in the
same named sqlserver instance) so if one update fails they will all
roll back. My development system is XP Pro and when I try to test the
below code I get an error about MSDTC being disabled.
using ( TransactionScope scope = new TransactionScope() )
{
using ( SqlConnection con = new SqlConnection(connstring) )
{
con.Open();
cmd1.ExecuteNonQuery();
cmd2.ExecuteNonQuery();
}
scope.Complete();
}
Can someone point out how to not use MSDTC when doing (lightweight)
transactions? The code will ultimately live in a class in an ASP.NET
2.0 web site.
Thanks.
sqlcommands on a connection (they update different databases in the
same named sqlserver instance) so if one update fails they will all
roll back. My development system is XP Pro and when I try to test the
below code I get an error about MSDTC being disabled.
using ( TransactionScope scope = new TransactionScope() )
{
using ( SqlConnection con = new SqlConnection(connstring) )
{
con.Open();
cmd1.ExecuteNonQuery();
cmd2.ExecuteNonQuery();
}
scope.Complete();
}
Can someone point out how to not use MSDTC when doing (lightweight)
transactions? The code will ultimately live in a class in an ASP.NET
2.0 web site.
Thanks.