c# - Linq to Excel issues -
i mapped out columns in excel, try , read worksheet using this
var file = thefile.worksheet<myclass>("worksheettitle").orderby(p => p.columnheader).tolist(); this error i'm getting:
system.data.oledb.oledbexception (0x80040e57): field small accept amount of data attempted add. try inserting or pasting less data. @ linqtoexcel.query.excelqueryexecutor.getdataresults(sqlparts sql, querymodel querymodel) @ linqtoexcel.query.excelqueryexecutor.executecollection[t](querymodel querymodel) @ remotion.data.linq.clauses.streameddata.streamedsequenceinfo.executecollectionquerymodel[t](querymodel querymodel, iqueryexecutor executor) @ remotion.data.linq.clauses.streameddata.streamedsequenceinfo.executequerymodel(querymodel querymodel, iqueryexecutor executor) @ remotion.data.linq.querymodel.execute(iqueryexecutor executor) @ remotion.data.linq.queryproviderbase.execute[tresult](expression expression) @ remotion.data.linq.queryablebase`1.getenumerator() @ system.collections.generic.list`1..ctor(ienumerable`1 collection) @ system.linq.enumerable.tolist[tsource](ienumerable`1 source)
this problem excel odbc driver can worked around reordering records in spreadsheet.. excel odbc driver has make assumption data type given column. driver reading ahead 8 records , looking @ data found. makes decision data type based upon has read. problems occur when assumption data type proven wrong subsequent records. column in excel spreadsheet has column in contains string data. first 8 records contain short strings. excel odbc driver reads data , assumes short string data type appropriate column. if subsequent record contains longer string. data type may prove inappropriate , unable store longer string , error willraised excel odbc driver. moving record long string beginning of dataset allow excel odbc select more appropriate data type column apply records in spreadsheet.
in cases technique arrange order of records such excel odbc driver allowed make correct selection of data type.
Comments
Post a Comment