Using SQL Server Stored Procedure for implementing Custom Paging

Rate It (2)

Last post 11-15-2009 11:00 AM by santhosh.vavilala. 7 replies.

Sort Posts:

  • Using SQL Server Stored Procedure for implementing Custom Paging

    03-30-2005, 5:19 AM
    • Star
      12,063 point Star
    • ranganh
    • Member since 02-11-2004, 11:35 PM
    • India
    • Posts 2,428

    Hi,

    All of us would have implemented Paging in our applications.

    Paging is particularly useful if you have lots of records to be displayed on a page and you can't get them displayed in one stretch. Say we have 1000 records to be displayed in a page. In this scenario, we cannot show up all the records in a single stretch in the page. Hence we need to implement Paging functionality whereby users can see a set of records and then click on a Button/Link to view the next set of records.

    This <a href="http://aspnet_harish.blogspot.com/2005_03_01_aspnet_harish_archive.html">Article</a> is useful to retrieve records in sets for displaying and useful in implementing custom paging.

    Thanks.


     

    regards,
    Harish

    http://geekswithblogs.net/ranganh
  • Re: Using SQL Server Stored Procedure for implementing Custom Paging

    03-31-2005, 3:42 AM
    • Member
      10 point Member
    • weibailin
    • Member since 03-29-2005, 7:00 AM
    • Posts 2

    hi,

    http://aspnet_harish.blogspot.com/2005_03_01_aspnet_harish_archive.html

    maybe it's not a correct link,I can't open it.Crying [:'(]

    thanks

  • Re: Using SQL Server Stored Procedure for implementing Custom Paging

    10-29-2009, 3:05 AM
    • Member
      20 point Member
    • Ramesh Bandi
    • Member since 10-16-2009, 11:09 AM
    • Naidupet
    • Posts 10

    hello

    the link is not working.

    Ramesh Bandi

  • Re: Using SQL Server Stored Procedure for implementing Custom Paging

    10-29-2009, 3:26 AM
    • Contributor
      4,448 point Contributor
    • stanly
    • Member since 02-09-2009, 4:35 AM
    • Chennai
    • Posts 1,006
  • Re: Using SQL Server Stored Procedure for implementing Custom Paging

    10-30-2009, 2:55 AM

    Hi,

    You can take a look at the following page for information on how to  page in ASP.NET:

    http://aspnet.4guysfromrolla.com/articles/091003-1.aspx

    Catherine Sea
    Version Control Software | Software Configuration Management Solution
  • Re: Using SQL Server Stored Procedure for implementing Custom Paging

    11-10-2009, 2:06 AM
    • Member
      11 point Member
    • LastPhoenix
    • Member since 11-09-2009, 5:11 PM
    • Posts 9

    Thank you guys for your solution , But in sql 2005 we have ROW_NUMBER() Function that help you write storedprocedure much easier :

    Look at this sp:

    CREATE PROCEDURE sprocEmailAddressSelectList
     
      @contactPersonId int,
      @startRowIndex int,
      @pageSize int
    
    AS
      
      SELECT 
        Id,
        Email,
        EmailType,
        ContactPersonId,
        ConcurrencyId
      FROM 
        (SELECT ROW_NUMBER() OVER (ORDER BY Id) AS Row, 
        Id,
        Email,
        EmailType,
        ContactPersonId,
        ConcurrencyId
        FROM EmailAddress) AS EmailRows
      WHERE 
        (Row between (@startRowIndex) AND @startRowIndex + @pageSize - 1)
        AND ContactPersonId = @contactPersonId


    for more information you can look at this article :

    http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=479

  • Re: Using SQL Server Stored Procedure for implementing Custom Paging

    11-12-2009, 4:45 AM
    • Member
      2 point Member
    • kiranvvr
    • Member since 11-12-2009, 9:27 AM
    • Posts 1

    This discussion is very helpfull to me.thank you
  • Re: Using SQL Server Stored Procedure for implementing Custom Paging

    11-15-2009, 11:00 AM
Page 1 of 1 (8 items)