Need advice on paging data from data source.

Discussion in 'ASP .Net' started by Ken Varn, Jan 12, 2005.

  1. Ken Varn

    Ken Varn Guest

    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
    -----------------------------------
     
    Ken Varn, Jan 12, 2005
    #1
    1. Advertising

  2. 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:eLA1D4L%...
    >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
    > -----------------------------------
    >
    >
     
    Philip Q [MVP], Jan 12, 2005
    #2
    1. Advertising

  3. Ken Varn

    Ken Varn Guest

    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]" <> wrote in message
    news:%23tUYW%23L%...
    > 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:eLA1D4L%...
    > >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
    > > -----------------------------------
    > >
    > >

    >
    >
     
    Ken Varn, Jan 12, 2005
    #3
  4. Ken Varn

    Shimon Sim Guest

    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:eLA1D4L%...
    >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
    > -----------------------------------
    >
    >
     
    Shimon Sim, Jan 12, 2005
    #4
  5. Ken Varn

    Joseph James Guest

    Please check these links.

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

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


    "Ken Varn" <nospam> wrote in message
    news:Ou8Rl6O%...
    > 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]" <> wrote in message
    > news:%23tUYW%23L%...
    >> 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:eLA1D4L%...
    >> >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
    >> > -----------------------------------
    >> >
    >> >

    >>
    >>

    >
    >
     
    Joseph James, Jan 19, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    DataSet paging vs Datareader paging

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    10,708
    Scott Allen
    Oct 8, 2004
  2. wh1974
    Replies:
    0
    Views:
    2,439
    wh1974
    Jan 12, 2005
  3. Red
    Replies:
    1
    Views:
    726
  4. Asun Friere
    Replies:
    1
    Views:
    507
    Paul Boddie
    Aug 27, 2003
  5. Author Tarun Tyagi
    Replies:
    0
    Views:
    718
    Author Tarun Tyagi
    Dec 29, 2004
Loading...

Share This Page