![](/img/trans.png)
[英]Issues in mapping Class Properties to Excel/Spreadsheet Column Names (when using LinqToExcel Library)
[英]How to find max value by linqtoexcel from the column(s) of excel spreadsheet?
我想通过使用linqtoexcel找到excel列的最大值。
ColumnA ColumnB
1 1
2 4
3 3
将返回
“max ColumnA为3”“max ColumnB为4”
将工作簿列映射到POCO
public class WorkSheetClass
{
public int ColumnA { get; set; }
public int ColumnB { get; set; }
}
然后使用LinqToExcel
string pathToExcelFile = @"C:\workbook1.xlsx";
string workbookName = "workbook1";
var columnAMaxValue = new ExcelQueryFactory(pathToExcelFile)
.Worksheet<WorkSheetClass>(workbookName)
.Max(x => x.ColumnA);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.