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

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

P: n/a
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
Apr 7 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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...
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

Apr 7 '06 #2

P: n/a
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.
Apr 7 '06 #3

P: n/a
Thanks a lot for clarifying that.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:Or**************@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.

Apr 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.