Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: Using foreach to deal with Excel rows and skip the 1st row as header

$
0
0
It really helped, but the trick was to use the correct type of parameter in Rows().
Since Rows() doesn't work, I used Rows((Func<IXLTableRow, bool>)null) and works fine.

The code changed to
foreach (var row in table.DataRange.Rows((Func<IXLTableRow, bool>)null)) 
{
  var name = row.Field("Name").GetString();
}
Thank you all!

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>