Home All Groups Group Topic Archive Search About

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



Author
7 Apr 2006 3:58 AM
sean
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

Author
7 Apr 2006 10:38 AM
Slim
why no give each record a id and use that instead of row and column

"sean" <sh***@removehotmail.com> wrote in message
news:irlZf.5108$_u1.690@pd7tw2no...
Show quote
>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
>
Author
7 Apr 2006 1:20 PM
Bob Barrows [MVP]
sean wrote:
Show quote
> 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.
Author
8 Apr 2006 6:21 AM
sean
Thanks a lot for clarifying that.

Show quote
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:OrSaMYkWGHA.3740@TK2MSFTNGP03.phx.gbl...
> 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.
>
>

AddThis Social Bookmark Button