我正在使用 OleDbConnection 类从 Excel 2000/2003 工作簿中检索数据:
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filename + ";" +
"Extended Properties=\"Excel 8.0;IMEX=1\";";
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();
// code to get table name from schema omitted
var dataAdapter = new OleDbDataAdapter(string.Format("SELECT * FROM [{0}]", name),connection);
var myDataSet = new DataSet();
dataAdapter.Fill(myDataSet, "ExcelInfo");
现在事实证明,工作表中长度大于 255 个字符的单元格将被截断。这是 Microsoft.Jet.OLEDB 提供程序的限制,还是我可以做些什么?
任何人?