Posts Tagged ‘User Control’

Custom Paging User Control in ASP.NET 2.0 with SQL Server 2005

November 17, 2008

Read above Topic

http://www.codeproject.com/KB/aspnet/paginguc.aspx

Creating the Stored Procedure in SOL 2005

as like this

create procedure [dbo].[Usp_UISHKFindDistrict]

@startRowIndex int=0,
@pageSize int=0
As
BEGIN
declare    @RecordCount int
set @RecordCount=0
SET NOCOUNT ON;

SET @startRowIndex = @startRowIndex + 1
set @RecordCount=0

Select @RecordCount=count(*)  from
tHKDistrict A,
tHKLocality B

Select
tDistrictCode,
tDistrictName_Eng,
tDistrictName_Arb,
tLocalityId,
LocalityName_Eng,
IsActive,
tRecordCount
From

(Select
A.tDistrictCode,
A.tDistrictName_Eng,
A.tDistrictName_Arb,
A.tLocalityId,
B.LocalityName_Eng,
A.IsActive,
ROW_NUMBER() OVER(ORDER BY A.tDistrictCode) as RowNum,  @RecordCount  as tRecordCount
from
tHKDistrict A,
tHKLocality B
) as temp WHERE RowNum BETWEEN @startRowIndex  AND (@startRowIndex + @pageSize - 1)

END

pagingdatagrid3

For Demo Code (source Code Download)

Any Queries Plz Contact Me : nissankg@yahoo.com

Advertisements