Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am new on data paging in MVC, i have a page which renders 5000 records it thrown an error which is given below:-

System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

to resolve this problem i want to apply paging so i just want to know can i apply client side paging to resolve my problem or i have to apply server side paging?

Thanks in advance.
Posted
Updated 2-Jun-15 2:26am
v2

1 solution

First of all you need to understand few things.

1) Any query which is bringing 1 record will also be able to bring 5000 records from the database. If the count is more than a lac or so then might need an optimization but still I don't think and as per my thinking if it is fetching more than 5 lacs rows then we might need to optimize it. It totally depends upon the server configuration.

Check your query if with putting a row limit your query is able to fetch the record without a timeout, let's say check with 5 rows or so. If yes then your query need to optimize and if not then it will very easily able to fetch 5000 record also.

2) Now coming to your second question that handling huge records at front-end level will help or not by using paging concept.
Answer : It depends, if your query is costly and taking time to fetch data then paging will decrease your database performance and even will make user to wait every time he clicks on page change button.
If your query is not costly then you can use paging concept as loading so much record at once on the browser will make client system(browser) very slow.

I hope I was able to answer your question.
 
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