繁体   English   中英

根据条件从EPPlus ExcelWorksheet获取行号

[英]Get row number from EPPlus ExcelWorksheet based on condition

如何根据匹配条件从ExcelWorksheet对象获取行号? 例如,需要以下内容:

int row = from w in WorkSheet
          where w.(rowValue) == matchingValue &&
                w.(secondRowValue) == secondMatchingValue
          select w.rowNumber

使用EPPlus可以做到吗?

我要做的是使用EPPlus将工作表加载到数据表中,如下所示: https ://stackoverflow.com/a/13396787/1316683

将行号作为该循环内的第一列,然后查询数据表:

DataRow[] matchingRow = myDataTable.Select(string.Format("rowValue = '{0}' AND secondRowValue = '{1}'", matchingValue, secondMatchingValue));
int row = matchingRow[0][0];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM