I tried

using (TransactionScope tran = new TransactionScope())
     using (var db = new MyDataContext())

but got compile error since TransactionScope does not exist.

Then I tried code from dblinq test

using (var db = new MyDataContext())
   {
    db.Connection.Open();
    db.Transaction = db.Connection.BeginTransaction();
    ... insert command to add document header
    db.SubmitChanges();
    int primarykey = mydoc.mykey;  // get autogenerated primary key value
    ... insert and update commands which use primarykey to add document row
    db.SubmitChanges();
    db.Transaction.Commit();
   }

but got runtime PostgreSql error telling that nested transactions are not 
supported.

How to use transactions in DbLinq ?

Andrus. 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to