Wednesday, September 13, 2017

how to query with LinqToExcel

To use this stuff, do something like so:

var excelSheet = new ExcelQueryFactory(myPathToFile);
IQueryable<Foo> welders = from f in excelSheet.Worksheet<Foo>("Sheet1")
      where f.Bar != ""
      select f;

 
 

Also: In Visual Studio 2015, right-click on the project and pick "Properties" and then click "Build" at the left nav of the pane that appears. Set the "Platform target:" from "Any CPU" to "x86" which is needed as Excel is a thirty-two bit application.

No comments:

Post a Comment