Find a record in which page where pages are generated using ADO pagination

Discussion in 'ASP General' started by sean, Apr 7, 2006.

  1. sean

    sean Guest

    I have a table with fixed row of records SORTED by DATE using ADO pagination
    method. The user can click a link in one table cell and go to another page
    to modify the record. Once the updated record is saved the user will be
    redirect back to the table. This time the record updated will be highlighted
    so that the user knows where he came from. I basically pass the page number,
    column and row number via querystring and store the info in a session so
    when the page goes back to the table I know where to hightlight. That all
    goes fine until....the user modified the DATE. Because the table is sorted
    by date the updated record won't be in the same physical location anymore
    :((. The updated record might show in several pages after or before. However
    the user still wants to see the record highlighted yet I don't really know
    the exact page number the updated record is on.

    I could re-query the whole database and find where the record is and
    calculate out the page number but it's apparently not very efficient and the
    perfomance will suffer when there are tens of thousands of records.

    Anyone has better idea? I'd appreciate it very much for some guidance here.

    Schen
    sean, Apr 7, 2006
    #1
    1. Advertising

  2. sean

    Slim Guest

    why no give each record a id and use that instead of row and column

    "sean" <> wrote in message
    news:irlZf.5108$_u1.690@pd7tw2no...
    >I have a table with fixed row of records SORTED by DATE using ADO
    >pagination method. The user can click a link in one table cell and go to
    >another page to modify the record. Once the updated record is saved the
    >user will be redirect back to the table. This time the record updated will
    >be highlighted so that the user knows where he came from. I basically pass
    >the page number, column and row number via querystring and store the info
    >in a session so when the page goes back to the table I know where to
    >hightlight. That all goes fine until....the user modified the DATE. Because
    >the table is sorted by date the updated record won't be in the same
    >physical location anymore :((. The updated record might show in several
    >pages after or before. However the user still wants to see the record
    >highlighted yet I don't really know the exact page number the updated
    >record is on.
    >
    > I could re-query the whole database and find where the record is and
    > calculate out the page number but it's apparently not very efficient and
    > the perfomance will suffer when there are tens of thousands of records.
    >
    > Anyone has better idea? I'd appreciate it very much for some guidance
    > here.
    >
    > Schen
    >
    Slim, Apr 7, 2006
    #2
    1. Advertising

  3. sean wrote:
    > I have a table with fixed row of records SORTED by DATE using ADO
    > pagination method. The user can click a link in one table cell and go
    > to another page to modify the record. Once the updated record is
    > saved the user will be redirect back to the table. This time the
    > record updated will be highlighted so that the user knows where he
    > came from. I basically pass the page number, column and row number
    > via querystring and store the info in a session so when the page goes
    > back to the table I know where to hightlight. That all goes fine
    > until....the user modified the DATE. Because the table is sorted by
    > date the updated record won't be in the same physical location
    > anymore :((. The updated record might show in several pages after or
    > before. However the user still wants to see the record highlighted
    > yet I don't really know the exact page number the updated record is
    > on.
    >
    > I could re-query the whole database and find where the record is and
    > calculate out the page number but it's apparently not very efficient
    > and the perfomance will suffer when there are tens of thousands of
    > records.
    >
    > Anyone has better idea? I'd appreciate it very much for some guidance
    > here.
    >

    I don't believe you can avoid requerying the database, even if you do take
    the correct step of using the database table's actual primary key to
    identify the row being edited. The only way you could avoid requerying is if
    you have the entire table cached in the web server's memory (or in a file),
    so you could re-apply the sort after the edit and find the record in the
    cached data. Given the table's size, you probably will not be able to cache
    its entire contents, which means requerying the database to determine the
    page in which the edited record will appear.

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Apr 7, 2006
    #3
  4. sean

    sean Guest

    Thanks a lot for clarifying that.

    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > sean wrote:
    >> I have a table with fixed row of records SORTED by DATE using ADO
    >> pagination method. The user can click a link in one table cell and go
    >> to another page to modify the record. Once the updated record is
    >> saved the user will be redirect back to the table. This time the
    >> record updated will be highlighted so that the user knows where he
    >> came from. I basically pass the page number, column and row number
    >> via querystring and store the info in a session so when the page goes
    >> back to the table I know where to hightlight. That all goes fine
    >> until....the user modified the DATE. Because the table is sorted by
    >> date the updated record won't be in the same physical location
    >> anymore :((. The updated record might show in several pages after or
    >> before. However the user still wants to see the record highlighted
    >> yet I don't really know the exact page number the updated record is
    >> on.
    >>
    >> I could re-query the whole database and find where the record is and
    >> calculate out the page number but it's apparently not very efficient
    >> and the perfomance will suffer when there are tens of thousands of
    >> records.
    >>
    >> Anyone has better idea? I'd appreciate it very much for some guidance
    >> here.
    >>

    > I don't believe you can avoid requerying the database, even if you do take
    > the correct step of using the database table's actual primary key to
    > identify the row being edited. The only way you could avoid requerying is
    > if
    > you have the entire table cached in the web server's memory (or in a
    > file),
    > so you could re-apply the sort after the edit and find the record in the
    > cached data. Given the table's size, you probably will not be able to
    > cache
    > its entire contents, which means requerying the database to determine the
    > page in which the edited record will appear.
    >
    > Bob Barrows
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    sean, Apr 8, 2006
    #4
    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. Robert Hanson
    Replies:
    4
    Views:
    559
    Tu-Thach
    Jul 22, 2003
  2. =?Utf-8?B?SmVmZg==?=

    Insert multiple record into table using ado.net ?

    =?Utf-8?B?SmVmZg==?=, Apr 14, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    980
    =?Utf-8?B?SmVmZg==?=
    Apr 14, 2004
  3. nita
    Replies:
    1
    Views:
    854
    Saravana
    Nov 20, 2004
  4. Henrik
    Replies:
    1
    Views:
    539
    Phillip Ian
    Jun 2, 2005
  5. ddog
    Replies:
    8
    Views:
    981
    Andrew Thompson
    Jan 10, 2007
Loading...

Share This Page