I have an excel sheet that I want to load into a datatable withe OleDb. The sheet contains a multiline text column with up to 1000 chars.
However, using this code below, I only have 256 chars in my DataTable per cell after the import.
Is this a limitation from the provider or is it possible to tell it to read the whole column?
var connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\file.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES;IMEX=1"";";
var sheetName = "Sheet1";
using (var con = new OleDbConnection(connectionString))
{
con.Open();
var table = new DataTable(sheetName);
var query = "SELECT * FROM [" + sheetName + "]";
OleDbDataAdapter adapter = new OleDbDataAdapter(query, con);
adapter.Fill(table);
return table;
}