views:

190

answers:

1

I'm using Linq to SQL on an SQL Compact database. I have a function where I insert multiple records into the database. I only call SubmitChanges at the end of the function. Would using a transaction (using the TransactionScope class) bring me any more performance or advantages?

+3  A: 

Linq to SQL uses a transaction within SubmitChanges, so you should not need to use one explicitly. From MSDN:

Immediately before any actual changes are transmitted, LINQ to SQL starts a transaction to encapsulate the series of individual commands.

driis