I have 2 linq 2 SQL statements I'd like to be in a transaction (the SQL server is remote, outside firewalls etc) all other communication works but when I wrap these 2 statements in a TransactionScope() I begin having to configure MSDTC which we did, but then there are firewall issues (I think) is there a simpler way?
the basics of what I want to do boil down to this: (both are stored procs under the hood)
using (var transactionScope = new TransactionScope())
{
Repository.DataContext.SubmitChanges();
Repository.DataContext.spDoFinalStuff(tempID, ref finalId);
transactionScope.Complete();
}
What is the simplest way to achieve this?
EDIT:
first I got this: The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)
On our servers I followed the instructions here to correct this. However the instructions don't seem to apply to windows 7 (my dev box) see my comment on above answer.
after correcting the issue (on the non win7 boxes) I get this: The transaction has already been implicitly or explicitly committed or aborted (Exception from HRESULT: 0x8004D00E) which some googling suggested may be firewall issue.
EDIT
I just discovered the remote DB is SQL 2000