I have a column in an excel file that contains both strings and numbers. I found through trial and error that ADO.NET infers the type of the column depending on the type of the cells of the first 8 rows. When that happens, all the strings under the column simply don’t get added to the DataTable.
My goal is to have ADO.NET read the values under that column as strings.
How can that be done?
add imex = 1 to your connection string similar to:
The IMEX parameter (1 is input mode) forces the data type of the column to text so that alphanumeric values are handled properly.