I am reading a .xls document into a dataset and I am having a problem that it is passing the entire column as a wrong data type. It thinks that the column is number based, when it should be string based. I have a lot rows that are just numbers then only few are letter, 1 or 2. I need it to treat the entire column as letters instead of numbers.
What is happening right now is when it encounters those 2 rows it reverts them to null and passes in everything else. I remember reading somewhere that excel determines the row type by first 8 columns, now if this is the problem does anyone know how I can disable this functionality and tell it that this column is a string.
I tried: Highlighting entire column > Right Click > Format > Selected Text and it still does not works.
Also tried: "Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=" + FileUpload1.PostedFile.FileName.ToString() + ";Extended Poperties=Excel 8.0;HDR=Yes;IMEX=1"
And: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileUpload1.PostedFile.FileName.ToString() + ";Extended Poperties=Excel 8.0;HDR=Yes;IMEX=1"
And: "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + FileUpload1.PostedFile.FileName.ToString() + ";Extended Properties=\"Excel 8.0;HDR=YES\";";
Error I get here is: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified