Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to implement data pagination in report without handling it in Stored procedure or query

i have dynamic data more than 100,000. i will pull out it from database.
so i do not want to use stored procedure method for paging.
i want to pull all data at one call ,then make pagination in my code.
Posted
Updated 17-Sep-15 22:30pm
v3
Comments
Krunal Rohit 18-Sep-15 3:51am    
Elaborate your question more.

-KR
Naveen.Sanagasetti 18-Sep-15 4:01am    
do you have static data.? please give more details.
Member 11823146 18-Sep-15 4:30am    
i have dynamic data more than 100,000. i will pull out it from database.
so i do not want to use stored procedure method for paging.
i want to pull all data at one call ,then make pagination in my code.

Use "Skip" and "Take" to retrieve individual pages from your datasource. As you have given no information about how you are retrieving the data it's not possible to say much more than that. Google "paging with skip take" for examples.
 
Share this answer
 
you can use Skip() & Take()[^] methods.

I'm using EF here, but you can change your code according to your need.
C#
var records = db.Employees.ToList();
var recordPerPage = records.Skip(pageSize * pageNumber).Take(pageSize);

-KR
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900