Skip to content

Instantly share code, notes, and snippets.

@ronnieoverby
Created February 16, 2013 20:13
Show Gist options
  • Select an option

  • Save ronnieoverby/4968531 to your computer and use it in GitHub Desktop.

Select an option

Save ronnieoverby/4968531 to your computer and use it in GitHub Desktop.
var bi = new BulkInserter<Person>(sqlConnection, "People");
bi.PreBulkInsert += (sender, args) =>
{
// args.DataTable - this is the actual datatable being written to the server
// you can modify the rows that will be written
// args.Items - this is an array of the objects used to create the datatable
// that will be written. modifying these objects at this point has no effect
// on the bulk insert operation, but it's nice to have them if you need them
};
bi.PostBulkInsert += (sender, args) => { /* same as PreBulkInsert, but after the insert happens */ };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment