I am reading data from an Excel document using OleDbDataAdapter.Fill method. I understand this reads the data into a DataTable.
How do we handle the situation where the data in an Excel column might have differing data types?
For example, if the data in an Excel column looks like this:
100
200
Some text
300
When the data is being read in the DataTable column (that is being loaded with the data) will be typed as double (since the first value in the column is a number). When it gets to the 3rd value ("Some text") instead of adding this text to the DataTable it adds a null (or empty string) instead.
The problem is I'd like to know what the values were in the Excel file column after it has been read in.
How do we capture the "Some text" text if the column has been typed as double and the text is then ignored?