How to get the row number of a DT and filter the DT

Hello friends!! Suppose I have a DT (dataTable) that has 350 rows. I want to filter the first 100 rows, and stay with the rest (from row 101 onwards). I want to know if there is any function to do that automatically, because otherwise I would have to improvise something manually.

Do you know anything about it? I was thinking about FilterDataTable, which can work with the current row number, but I could not do it. I was thinking of something like this:


Can you try this

rowNo = 101
totalRows = dt.rows.count
while (rowNo < totalRows)
variable = dataTable.rows(rowNo).item(0).toString
//process variable
rowNo = rowNo+ 1

1 Like

Thank you!!

Another way to do it is with Enumerable.skip(n) where n = number of rows to skip

Example: dt1.AsEnumberable().skip(100)
This would give you a variable type IEnumerable which you could then iterate over for more processing (using for each)

1 Like

Thank you Dave!!