title: SqlBulkCopy Insert with Identity Column
body: <p>I am using the <code>SqlBulkCopy</code> object to insert a couple million generated rows into a database. The only problem is that the table I am inserting to has an identity column. I have tried setting the <code>SqlBulkCopyOptions</code> to <code>SqlBulkCopyOptions.KeepIdentity</code> and setting the identity column to <code>0</code>'s, <code>DbNull.Value</code> and <code>null</code>. None of which have worked. I feel like I am missing something pretty simple, if someone could enlighten me that would be fantastic. Thanks!</p>
  
  <p><em>edit</em> To clarify, I do not have the identity values set in the <code>DataTable</code> I am importing. I want them to be generated as part of the import.</p>
  
  <p><em>edit 2</em>
      Here is the code I use to create the base <code>SqlBulkCopy</code> object.</p>
  
  <pre><code>SqlBulkCopy sbc = GetBulkCopy(SqlBulkCopyOptions.KeepIdentity);
  sbc.DestinationTableName = LOOKUP_TABLE;
  
  private static SqlBulkCopy GetBulkCopy(SqlBulkCopyOptions options = 
      SqlBulkCopyOptions.Default) 
  {
      Configuration cfg = WebConfigurationManager.OpenWebConfiguration("/RSWifi");
      string connString =
      cfg.ConnectionStrings.ConnectionStrings["WifiData"].ConnectionString;
      return new SqlBulkCopy(connString, options);
  }
  </code></pre>