SQL Bulk Copy can be used with just a few lines of code.

  1. Instantiate the BulkCopy class, connect to the database and initialize the bulk copy operation:
    var bc = new BulkCopy();
    
    bc.Connect("ODBC connection string goes here");
    bc.Initialize("table name goes here");
  2. Bind the columns:
    var column1 = bc.BindInt();
    var column2 = bc.BindDateTime2();
  3. For each row, assign column values and call SendRow:
    column1.SetValue(1);
    column2.SetValue(DateTime.Now);
    
    bc.SendRow();
  4. For every n rows (your batch size), call:
    bc.Batch();
  5. And when you’re done, call:
    bc.Done();

It really is that easy. But for more detail, please read the Tutorial.