title: csv file bulk insert sql server
body: <p>I have a problem when trying to insert a <code>.csv</code> file using bulk insert into SQL Server.</p>
  
  <p>Csv file example rows at below:</p>
  
  <pre><code>16777216,16777471,AU,AUSTRALIA,APNIC DEBOGON PROJECT
  16777472,16778239,CN,CHINA,CHINANET FUJIAN PROVINCE NETWORK
  16778240,16779263,AU,AUSTRALIA,LEVEL 5 530 COLLINS STREET
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>CsvReader csv = new CsvReader(new StreamReader(fileName), false, ',', '\0', '\0', '\0', LumenWorks.Framework.IO.Csv.ValueTrimmingOptions.All);
  
  csv.DefaultParseErrorAction = ParseErrorAction.AdvanceToNextLine;
  csv.MissingFieldAction = MissingFieldAction.ReplaceByNull;
  
  copy = new SqlBulkCopy(conn, SqlBulkCopyOptions.KeepIdentity, transaction);
  copy.DestinationTableName = "Blabla";
  
  var mapping1 = new SqlBulkCopyColumnMapping(0, "ipFrom");
  copy.ColumnMappings.Add(mapping1);
  
  var mapping2 = new SqlBulkCopyColumnMapping(1, "ipTo");
  copy.ColumnMappings.Add(mapping2);
  
  var mapping3 = new SqlBulkCopyColumnMapping(2, "countryCode");
  copy.ColumnMappings.Add(mapping3);
  
  var mapping4 = new SqlBulkCopyColumnMapping(3, "countryName");
  copy.ColumnMappings.Add(mapping4);
  
  var mapping5 = new SqlBulkCopyColumnMapping(4, "isp");
  copy.ColumnMappings.Add(mapping5);
  
  
  copy.WriteToServer(csv);
  transaction.Commit();
  </code></pre>
  
  <p>Result table is:</p>
  
  <blockquote>
    <p>"16777216 16777471 AU AUSTRALIA APNIC DEBOGON PROJECT" "16777472 16778239 CN CHINA CHINANET FUJIAN PROVINCE NETWORK" "16778240 16779263 AU AUSTRALIA LEVEL 5 530 COLLINS STREET"</p>
  </blockquote>
  
  <p>I can't handle this file line by line because file has approximately 100 million lines</p>
  
  <p>How can I discard at the end and start double quotes?</p>