Need advice on paging data from data source.

K

Ken Varn

I am displaying data from a SQL Server database on my ASP.NET web form. The
data table that I am displaying is huge and it must be paged. What I would
like to do is display 10 records at a time and allow the user to jump to a
particular page if they desire. I would like my interface to display the
total number of pages and offer the user the ability to select which page
they would like to display. I have not figured out how I can do this. All
articles that I have read assume that you are just paging forward or paging
backward by one page rather than skipping around. Does anyone have any
information on methods that can be used to do what I am describing?


--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
 
P

Philip Q [MVP]

The DataGrid is probably what you're after, it provides the ability to page
data and provide the pager controls.
After you have databound the control, you can use the PageCount property to
find the total number of pages and get/set the CurrentPageIndex property
(remember to re DataBind() after setting) to change the current page.
 
K

Ken Varn

It's my understanding that the entire dataset needs to be loaded in order to
accomplish this. Is this true? If so, it is not very practical in my case
because the dataset may be too huge to load into memory in its entirety.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
Philip Q said:
The DataGrid is probably what you're after, it provides the ability to page
data and provide the pager controls.
After you have databound the control, you can use the PageCount property to
find the total number of pages and get/set the CurrentPageIndex property
(remember to re DataBind() after setting) to change the current page.
 
S

Shimon Sim

I don't know a simple way.
There is good reason that those example on the web don't allow you to jump
around. It is because you can't know where to jump in generic example unless
you load the whole data.
If you have huge data to load and you MUST provide jumping around try to
cash keys only and based on the keys retrieve records from the database.
This is all will be fine if sorting is not an issue. If sorting is a issue
then you will need to load the fields that you sort by also and then it will
get even more complicated.
Have fun.
Shimon,
www.siatadev.com
 
J

Joseph James

Please check these links.

http://www.codeproject.com/aspnet/PagingLarge.asp

http://msdn.microsoft.com/msdnmag/issues/05/01/ASPNETPerformance/default.aspx


Ken Varn said:
It's my understanding that the entire dataset needs to be loaded in order
to
accomplish this. Is this true? If so, it is not very practical in my
case
because the dataset may be too huge to load into memory in its entirety.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
Philip Q said:
The DataGrid is probably what you're after, it provides the ability to page
data and provide the pager controls.
After you have databound the control, you can use the PageCount property to
find the total number of pages and get/set the CurrentPageIndex property
(remember to re DataBind() after setting) to change the current page.

--
Philip Q
Microsoft MVP [ASP.NET]

Ken Varn said:
I am displaying data from a SQL Server database on my ASP.NET web form.
The
data table that I am displaying is huge and it must be paged. What I
would
like to do is display 10 records at a time and allow the user to jump
to a
particular page if they desire. I would like my interface to display the
total number of pages and offer the user the ability to select which page
they would like to display. I have not figured out how I can do this.
All
articles that I have read assume that you are just paging forward or
paging
backward by one page rather than skipping around. Does anyone have any
information on methods that can be used to do what I am describing?


--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
 

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

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top