Tutorial :Why is my OLE data source data not querying consistently?



Question:

I have a Microsoft Excel 2003 file that I am querying from C# 2.0 using an OleDbConnection.

One of the cells in the Excel file is formated as a short date and displays in Excel as "1/1/2009". If I change the format to General the text displayed in that cell changes to "39814".

If I query the Excel file while the file is open, I receive "39814" in the result set.

If I query the Excel file while the file is closed, I receive "1/1/2009" in the result set.

Why the inconsistency with importing data from this Ole Data Source?

Thank you,
Keith


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »