DateTime format mismatch on importing from Excel Sheet
<p>I'm importing data from an Excel sheet on to a <code>DataTable</code> using the following code:</p>

<pre><code>OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + ";Extended Properties=Excel 8.0");
con.Open();
_myDataSet = new DataSet();
OleDbDataAdapter myCommand = new OleDbDataAdapter(" SELECT * FROM [" + "Sheet1" + "$]", con);
myCommand.Fill(_myDataSet);
con.Close();
</code></pre>

<p>I have a <code>Date</code> column in the Excel sheet in the format <code>dd/MM/yyyy</code>. The above code is failing when the date is <code>dd/MM/yyyy</code> (eg. <code>27/12/2009</code>). How to specify the date format?</p>

<p>EDIT (adding more details):</p>

<p>It is not throwing any exception. Data is imported to the <code>DataSet</code> until the row where an invalid <code>Date</code> format is encountered. I have the date as <code>dd/MM/yyyy</code> in Excel sheet. When I import using <code>OleDbDataAdapter</code>, it is expecting the date in the Excel sheet to be in <code>MM/dd/yyyy</code>. No naturally when it encounters a date such as <code>27/2/2009</code> it stops the process of importing, though no error/exception is thrown. So I'm having only partial results in <code>DataTable</code>.</p>

<p>Please help.</p>
