ITTreats.com
Enter your Search term and Hit "Enter"

Thu, 11 Mar 2010 10:33:50 PM +00:00

Latest 'ITTreats'


Paginating in ASP

Paginating in ASP

Pagination in asp, plays major roll when you want to display page wise results , what if the recordset size is more or huge, in that case the processing of the page will become slow…

For that here is the query , which will really help you

the following query is MSSQL query

For example if you want employee name whose
salaries are 2nd highest and 1oth highest

Now,

step 1 :select *, ROW_NUMBER() over ( salary desc) as ROWID from emp

step 2 : supply the above query as sub query

select * from ( select *,ROW_NUMBER() over (salary desc) as ROWID from emp ) where rowid between 2 and 10

thats it .. now you will get emploee list from 2nd highest salary to 10th highest salary ,,,,

by making use of the above query in pagination purpose, then your page will never slow down becoz, we are putting only 10 to 100 rows at max ,