title: Microsoft.Jet.OLEDB.4.0 weird issue reading csv file
body: <p>I have a weird issue reading a .csv file using c#. Here are the file contents:</p>
  
  <pre><code>**ColumnName,                   Column Value**
  Bestemming,                     aaa.asp
  BuEn_SubSystem,                 B
  BusinessListActive,             FALSE
  cancreatelogin,                 0
  CDTAccess,                      Y
  CDTAssessmentNo,                4172
  CDTAssessRO,                    N
  CDTCntComp,                     0
  CDTCntOnf,                      0
  ***CDTExpiry,                   1***
  </code></pre>
  
  <p>I am using the following code to read the file:</p>
  
  <pre><code>using System;
  using System.Data;
  using System.IO; //not used by default
  using System.Data.OleDb; //not used by default
  
  
  class CSVParser
      {
          public static DataTable ParseCSV(string path)
          {
              if (!File.Exists(path))
                  return null;
  
              string full = Path.GetFullPath(path);
              string file = Path.GetFileName(full);
              string dir = Path.GetDirectoryName(full);
  
  
              //create the "database" connection string 
              string connString = "Provider=Microsoft.Jet.OLEDB.4.0;"
                 + "Data Source=\"" + dir + "\\\";"
                 + "Extended Properties=\"text;HDR=Yes;FMT=Delimited\"";
  
              //create the database query
  
              string query = "SELECT * FROM " + "[" + file + "]";
  
              //create a DataTable to hold the query results
              DataTable dTable = new DataTable();
  
  
              //create an OleDbDataAdapter to execute the query
              OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, connString);
  
              try
              {
                  //fill the DataTable
                  dAdapter.Fill(dTable);                  
  
              }
              catch (InvalidOperationException /*e*/)
              { }
  
              dAdapter.Dispose();
  
              return dTable;
          }
      }
  </code></pre>
  
  <p>for some reason the <strong>CDTExpiry</strong> field is giving an issue. All I have to do is change the numeric to non-numeric for that field only and it works fine!! e.g <strong><em>CDTExpiry,1</em></strong> to <strong><em>CDTExpiry,a</em></strong>.</p>
  
  <p>Anyone know why this would be happening, as I am using this code for a bulk load of data from the csv file, and I don't want to always check the file first for this line of Code.</p>
  
  <p>tx</p>