I am using linqToExcel to read some .csv files and put in a table.
var excelFile = new LinqToExcel.ExcelQueryFactory(file);
var result = (from row in excelFile.Worksheet(0)
let item = new IncomingPayments
{
Code = row["Code"].Cast<string>(),
Name = row["Name"].Cast<string>(),
CustomerCode = row["CustomerCode"].Cast<string>(),
Amount = row["Amount"].Cast<double>(),
Type = row["Type"].Cast<string>(),
}
select item).ToList();
An example of the data I am reading:
Problem is that when I get to the rows where the A & B column has a dash, they all return as null. Seems like linqToExcel assumes the colums are int, even when I cast as string. How can I avoid this and get this to work properly?
