linq to excel - LinqToExcel blank rows

I am using LinqToExcel to easily import Excel data into SQL Server. var fileName = ConfigurationManager.AppSettings["ExcelFileLocation"]; var excel = new ExcelQueryFactory(fileName); var employees = excel.Worksheet<Employee>().ToList();Everything's fine, there is only 1 problem, the fields mapped exactly to the database table fields, and in the database they are NOT NULL.Having said that, if you look at this screenshot of Excel file, some rows below row 3 are actually not empty. There are no spaces, but somehow LinqTo...Read more

Can I specify the data type for a column rather than letting linq-to-excel decide?

I have noticed the following when working with linq-to-excel:I'm trying to import rooms from a spreadsheet.I have a simple class public class Room { public int BuildingID { get; set; } public string RoomNumber { get; set; } public double SQM { get; set; } public string Notes { get; set; } }The room numbers in the spreadsheet are either simple numbers e.g. 101, 102, 34 etcor they have a character prefix e.g. AV1, LH2 etcIf the 1st row in my sheet starts with an alphanumeric room number (e.g. LH1), everything i...Read more

linq to excel - LinqToExcel External table is not in the expected format

I've been using LinqToExcel to parse an exel document for a while and suddenly it's stoped working. I'm getting the following error: External table is not in the expected format.Any ideas why this is happening? Or how to fix? if (File.Exists(filenameFull)) { var excel = new ExcelQueryFactory(filenameFull); IList<Row> scanningRangesRows = excel.Worksheet("B - Scanning Ranges").ToList();I was using version LinqToExcel 1.6.3, when the problem started happening I updated to the...Read more

linq to excel - LinkToExcel group by and Sum

I am trying to use LinqToExcel to solve an issue, and I am having some problems. We get this excel file that tells us the product that we will be receiving. I need to read that file and save the updates to the database. Everything is fine except when we get 2 records in the file with the same partNumber. The requirement is to merge the records prior to saving them to the database. If I could use "group by" I could just sum the Qty, but apparently I can't do a group by with LinkToExcel, so can anyone give me some hints on how to solve this i...Read more