Delete a lot of rows

lets assume we do have a datatable with 4589 rows and want to delete / skip the first 1000 rows:

yourDataTableVar.AsEnumerable.Skip(1000).CopytoDataTable

will return a datatable with the without the origin first 1000 rows (3589 rows)

When we want to make it more flexible we just use a variable: skipCount and can set it as we want to use:

skipCount = 1000
yourDataTableVar.AsEnumerable.Skip(skipCount).CopytoDataTable

2 Likes