title: How to fix "Not a legal OleAut date." when reading an Excel file in C#?
body: <p>I have been working with excel spreadsheets and so far I never had any problems with them.. But this error,"Not a legal OleAut date.", showed up out of the blue when I tried to read an excel file. Does anyone know how I can fix this. Here is the code I use to read the excel and put the data into a dataset. It has worked fine previously but after I made some changes (which doesn't involve dates) to the data source this error showed up.</p>
  
  <pre><code>var fileName = string.Format("C:\\Drafts\\Excel 97-2003 formats\\All Data 09 26 2012_Edited.xls");
          var connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; data source={0}; Extended Properties=Excel 8.0;", fileName);
  
          var adapter = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", connectionString);
  
          DataSet Originalds = new DataSet();
          adapter.Fill(Originalds, "Employees"); // this is where the error shows up
  </code></pre>