I'm getting a input string was not in correct format when parsing an excel file with LINQ to Excel:
var excel = new ExcelQueryFactory(ExcelFileURI);
excel.DatabaseEngine = DatabaseEngine.Ace;
var items = excel.Worksheet<StatusPedido>(sheetName);
List<StatusPedido> list = items.ToList(); //Error points here
StatusPedido is my own class and it has 5 int attributes, each corresponding to a column in the excel file, that could be causing this error but I can't find which or where the error is coming from.
the query doesn't execute until it's enumerated and using the .ToList()
method doesn't show which item (1600 excel lines) is even causing the error so I'm not sure where to look.
Is there a way to Iterate through the 'Items' IQueryable
one by one to find which one is failing to cast into a StatusPedido - and hence identify which row/cell in the excel is throwing this error?