I am trying to read the following excel file with C#.
I've tried both of these connection strings:
First connection string: I get the correct values for the header and null for all the other cells.
sbConnection.Provider = "Microsoft.ACE.OLEDB.12.0";
strExtendedProperties = "Excel 12.0;HDR=Yes;";
Second connection string: I get incorrect values for the header and the correct ones for all the other cells.
sbConnection.Provider = "Microsoft.ACE.OLEDB.12.0";
strExtendedProperties = "Excel 12.0;HDR=Yes;IMEX=1";
Using the extended properties solved my problem in reading mixed type data(header). But, now, it is not reading the decimal ,dates and percent values in my data.
With both connection strings I get for some cells null although I have values in them. How could I modify the connection string in order to read the Excel file properly?
Any help would be most appreciated.