Paging question

M

majiofpersia

Hi all and thanks in advance for your help,

I am reading this book called ASP.NET unleashed and on the datagrid section
it says that there is a disadvantage with paging with the datagrid. That
when you do paging with the datagrid and datasets, all the records must be
retrieved from the datasource every time you navigate to a new page. So, if
you have a large dataset then that will cause performance problems.

I don't know about this .... it just doesn't sound too right to me.
Specially since datasets are disconnected from the data source. And my
assumption was that they act as containers for the data ... which suggests
to me that once we are using a dataset and datagrid combination, there is no
need to refer back to the data source ...
If this is a known problem, does that mean that this is a bug?

I personally think that the author of the book is wrong, what do you guys
think?

Thanks for your input,

Majiofpersia
 
P

Prasad

Hi

When AllowPaging is set to True for DataGrid. These are the things are
done by the DataGrid :

1. It will Show the Pager UI
2. It will raise OnPageIndexChanged from where we can set
clicked PageIndex

Only the above things are done by the DataGird. Its Developer's
responsible to Bound the Grid and set the PageIndex. So to achieve that we
need to requery the Database everytime and bound it to the grid by setting
PageIndex. For Efficient you can use Programming Logic, or use ASP Caching
features.

HTH
Prasad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top