Hey all,
I'm trying to import some data from an Excel spreadsheet into my C# application using OleDB. I use the standard connection string with the IMEX=1,HDR=YES options
Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties="Excel 12.0;HDR=YES;IMEX=1"
I have a column where the values are mostly the text: TRUE or FALSE. Partway down there is a couple of values of BLANK. When the import happens, the BLANK values are replaced empty strings. This is presumably because OleDB determined the data type of the column to be boolean and doesn't import any non-boolean values, like BLANK.
I tried the solution in this answer but it did not work. Even when I pre-create the DataTable and set its columns to all have a datatype of string, the BLANK values continue to be removed.
I have tried hacking the registry key suggested in the same question but to no effect.
Is there any recourse? Or am I going to have to try to use COM? We don't have the budget for SpreadsheetGear and I can't use excellibrary because I have to deal with .xlsx files mostly.
Thanks in advance