Skip to content

Instantly share code, notes, and snippets.

@danmusk
Created May 8, 2014 11:49
Show Gist options
  • Save danmusk/23d0c96aec7ec1f037ca to your computer and use it in GitHub Desktop.
Save danmusk/23d0c96aec7ec1f037ca to your computer and use it in GitHub Desktop.
BulkInsert (transaction)
var insert = @"
INSERT INTO table (value1, value2)
VALUES (@value1, @value1);
";
using (var scope = new System.Transactions.TransactionScope())
{
_dbConnection.Open();
_dbConnection.Execute(insert, listOfStuff);
scope.Complete();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment