Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Find a record in which page where pages are generated using ADO pagination

Reply
Thread Tools

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

 
 
sean
Guest
Posts: n/a
 
      04-07-2006
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


 
Reply With Quote
 
 
 
 
Slim
Guest
Posts: n/a
 
      04-07-2006
why no give each record a id and use that instead of row and column

"sean" <(E-Mail Removed)> 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
>



 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      04-07-2006
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.


 
Reply With Quote
 
sean
Guest
Posts: n/a
 
      04-08-2006
Thanks a lot for clarifying that.

"Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Record pagination tag for .jsp pages? ddog Java 8 01-10-2007 05:10 PM
Pagination function for search page returning too many hits to display on one page. Henrik ASP .Net 1 06-02-2005 01:17 PM
Accessing an ADO Recordset or Record from ADO.NET nita ASP .Net 1 11-20-2004 07:06 AM
Error when trying to add an Access DB Record containing a Long Integer type field using OLEDB in ADO.Net Robert Hanson ASP .Net 4 07-22-2003 01:40 PM
Re: Error when trying to add an Access DB Record containing a Long Integer type field using OLEDB in ADO.Net Robert Hanson ASP .Net 1 07-22-2003 12:54 PM



Advertisments