开发者

Querying Excel Worksheets using LinQ - LinQToExcel

I'm using LinQToExcel to read my excel worksheets.ExcelQueryFactory has a method that 开发者_运维技巧returns a worksheet based on worksheet name(Only one value(Name) is allowed).There is also a method that returns WorkSheet names. Is there a way to use LinQ to select multiple worksheet collection based on names.

ExcelQueryFactory test = new ExcelQueryFactory(FilePath); List names = targetExcelFactory.GetWorksheetNames().ToList(); var sheet = test.Worksheet("sheet1");


Enumerable.Select lets you turn the result from one set into a completely other set aka projection.

var result = targetExcelFactory.GetWorksheetNames()
  .Select(name => test.Worksheet(name))
  .ToList();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜