views:

61

answers:

2

Hi, we are using linq-to-sql in a desktop project? How should we handle transactions? What about using transaction scope?

+3  A: 

Linq-to-sql supports three transaction models described here.

You can use TransactionScope to bracket several actions.

Corbin March
+1  A: 

I am in the process of creating a business logic and data access logic layer for our application framework. We are using Linq-to-SQL. For simple transactions, we use the default L2S transaction support that the SubmitChanges() method call uses. For more complex transactions, we use Transaction Scope. Transaction scope works very well, and won't escalate to an MTC transaction if the transaction is limited to a single database and single connection.

Randy

Randy Minder