Is there any way to apply skip and take in Datatable in asp.net core 2.0. without converting to any class type? I have used stored procedure to get data and convert to Datatable, I want to apply pagination in this Table, how can I do this?
Asked
Active
Viewed 355 times
0

Vivek Nuna
- 25,472
- 25
- 109
- 197

Jiju John
- 821
- 3
- 14
- 35
-
something like this: https://stackoverflow.com/questions/2380413/paging-with-linq-for-objects ? – pix Jun 05 '20 at 09:34
-
@pix I don't have a class type, its a datatable – Jiju John Jun 05 '20 at 09:41
1 Answers
1
You can not use becuase it does not implement the IEnumerable<T>
. But you can do this by using AsEnumerable
extension method.
DataTable dt = new DataTable();
IEnumerable<DataRow> rows = dt.AsEnumerable().Skip(10).Take(10);
Above solution works for .Net Core version >= 3
For .Net Core version 2. You need to install the package.
System.Data.DataExtensions

Vivek Nuna
- 25,472
- 25
- 109
- 197