By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,116 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,116 IT Pros & Developers. It's quick & easy.

Need advice on paging data from data source.

P: n/a
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
-----------------------------------
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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" <nospam> wrote in message
news:eL****************@tk2msftngp13.phx.gbl...
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
-----------------------------------

Nov 19 '05 #2

P: n/a
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 [MVP]" <wi******@NOSPAMmvps.org> wrote in message
news:%2********************@TK2MSFTNGP10.phx.gbl.. .
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" <nospam> wrote in message
news:eL****************@tk2msftngp13.phx.gbl...
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
-----------------------------------


Nov 19 '05 #3

P: n/a
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
"Ken Varn" <nospam> wrote in message
news:eL****************@tk2msftngp13.phx.gbl...
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
-----------------------------------

Nov 19 '05 #4

P: n/a
Please check these links.

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

http://msdn.microsoft.com/msdnmag/is...e/default.aspx
"Ken Varn" <nospam> wrote in message
news:Ou****************@TK2MSFTNGP10.phx.gbl...
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 [MVP]" <wi******@NOSPAMmvps.org> wrote in message
news:%2********************@TK2MSFTNGP10.phx.gbl.. .
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" <nospam> wrote in message
news:eL****************@tk2msftngp13.phx.gbl...
>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
> -----------------------------------
>
>



Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.