G
GaryDean
When I use transactions with sql server I usually do this...
using (TransactionScope scope = new TransactionScope)
{
using (SqlConnection1 = new SqlConnection . . . . .
and this all works great. But now, I need to stretch the transaction across
to sql databases using two different connections i.e.
using (TransactionScope scope = new TransactionScope)
{
using (SqlConnection1 = new SqlConnection . . . . .
{
work
work
}//dispose of connection
using (SqlConnection2, - new SqlConnection . . . . .
{
work
work
}//dispose of connection
scope.Complete();
}//dispose of transaction scope
Is this supposed to work this way? Can a TransactionScope stretch across
many databases and cause a rollback of them all if an exception occurs?
using (TransactionScope scope = new TransactionScope)
{
using (SqlConnection1 = new SqlConnection . . . . .
and this all works great. But now, I need to stretch the transaction across
to sql databases using two different connections i.e.
using (TransactionScope scope = new TransactionScope)
{
using (SqlConnection1 = new SqlConnection . . . . .
{
work
work
}//dispose of connection
using (SqlConnection2, - new SqlConnection . . . . .
{
work
work
}//dispose of connection
scope.Complete();
}//dispose of transaction scope
Is this supposed to work this way? Can a TransactionScope stretch across
many databases and cause a rollback of them all if an exception occurs?