How do I iterate through rows in an excel table using epplus?

后端 未结 6 1232
暖寄归人
暖寄归人 2021-01-30 20:19

I am new to epplus, and i\'m trying to read some values from an excel table.

This is what I have so far:

var fileInfo = new FileInfo(filename);
using(var e         


        
6条回答
  •  一整个雨季
    2021-01-30 20:44

    Im not sure of epplus, but I thought I would make a quick suggestion of using LinqToExcel

    var excel = new ExcelQueryFactory(excel);
    
    var info = excel.Worksheet("Sheet1")
                    .Select(z=> new
                         {
                          Name = row["Name"].Cast(),
                          Age = row["Age"].Cast(),
                         }).ToList();
    

    you can get it from NuGet

    Install-Package LinqToExcel
    

提交回复
热议问题