Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 446539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:28:51+00:00 2026-05-12T21:28:51+00:00

What’s the best method to do paging in my ASP page when displaying a

  • 0

What’s the best method to do paging in my ASP page when displaying a list of items?

I knew that there is no equivalent to MySQL’s LIMIT clause present in SQL Server, either 2000 or 2005.

How can I retrieve some particular records (Records 20 to 30) from the DB?

Do i need to fetch all the records from the database and do something in my ASP page to display the required records?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T21:28:52+00:00Added an answer on May 12, 2026 at 9:28 pm

    Whats the best method to do paging in my ASP page when displaying a list of items ?

    I just want to add one more feature to Mr. Wheat’s answer. Why not u are trying to use the Take () and Skip() feature of linq(obviously if u are using dotnet framework 3.5+)

    It is indeed helpful while working with large datasets.

    Have a look
    Using Take and Skip method in LINQ queries

    I knew that there is no MySQL LIMIT clause present in SQL server(both 2000 and 2005 should support).how can i retrieve some particular records (Record 20 -30) from DB ?

    You can do this in SQLSERVER 2005+ by using ranking function Row_Number() among other alternatives. A sample example is included herewith

    First I am creating a dummy table and inserting some 50 records

    declare @tbl table(name varchar(50),age int)
    ;with num_cte as
    (   select 1 as rn
        union all
        select rn+1 from num_cte where rn<50
    )  
    insert @tbl
    select  names ,rn + 20 ageval                
    from num_cte
    cross apply( select  'name' + CAST(rn as varchar(2))  AS names) names
    select * from @tbl
    

    Now by using the Row_Number() function I am picking up records between 20 & 30

    select name,age from(
    select ROW_NUMBER()over (order by age) as rownum,name,age from @tbl) X
    where X.rownum between 20 and 30
    

    However, for achieving the same in SQL SERVER 2000 the below query will help

    select name,age from(
    select t1.name,t1.age,
    (select count(*)+1 from @tbl where name<>t1.name and age<=t1.age) rownum
    from @tbl t1
    )X(name,age,rownum)
    where rownum between 20 and 30
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.