I'm needing to import an Excel spreadsheet into my program and have the following code:
string connectionString = String.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;IMEX=1;HDR=NO;""", MyExcelFile.xls);
command.CommandText = "SELECT * FROM [Sheet1$]";
(Note, code above isn't real code but should let you see what I'm doing)
I'm getting the file imported, only problem is any columns in the Excel sheet which are over 255 characters are being truncated.
Is there any way around this happening?
I read somewhere that if you make sure there is a long line of text in the column within the first 8 rows, then it will be treated as a memo field and therefore not truncated but that didn't seem to work.
Any ideas?
Graeme