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

I have been asked by a question in one interview.

Q:If my gridview page is displaying 100 records /page and it have 10 pages means the total records are 1000 ,how can you handle it?


This is the question can any one give answer please.
Posted
Updated 27-Jul-11 3:53am
v2

 
Share this answer
 
 
Share this answer
 
Then main concern of the interviewer is performance issue with Gridview paging. Because if you are using Gridview paging then it will be very costly in terms of memory. Because all records save in memory and can be performance issue. So simple answer is, in this case we will use
- Always use Sql Reader to bind the gridview
- Implement paging on Sql server side. Do not use Gridview paging.
 
Share this answer
 
Comments
_Zorro_ 27-Jul-11 10:07am    
Absolutely, but 1000 rows is not a "large amount of data", at least to me.
But I agree with your ccomment anyway. +5
Parwej Ahamad 27-Jul-11 10:12am    
Yes practically it is not a large but iterviewer intention was same to asking this question.
Answered here.[^]
 
Share this answer
 
I didn't exactly understood the question (how can you handle what exactly?), but I'll try...

How would you do to display 1000 records showing 100 items by page?

Paging: GridView Examples for ASP.NET 2.0: Paging and Sorting the GridView's Data[^]
 
Share this answer
 
v2

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