Posts

Showing posts from November, 2022

Paging in MVC with sql datanbase

Data base create table tblCustomer([CustomerID]   int identity(1,1)              ,[CompanyName]   varchar(100)              ,[ContactName]  varchar(100)              ,[ContactTitle]  varchar(100)              ,[Address]   varchar(100)              ,[City]  varchar(100)              ,[Region]  varchar(100)              ,[PostalCode]  varchar(100)              ,[Country]  varchar(100)              ,[Phone]  varchar(100)              ,[Fax]  varchar(100) )          ------------- insert into tblCustomer ( CompanyName,ContactName,ContactTitle,Address...

paging

 create proc getPaging( @noofpages int,@Currentpage int,@result varchar(1000) out) as begin --declare @noofpages int=10,@Currentpage int=1,@result varchar(1000)='' Declare @noofshowpage int=5,@min int=1,@max int=0,@type varchar(10)='Next' set @result='' if(@Currentpage%@noofshowpage=0) begin set @min=@Currentpage if(@type='Next') begin if(@noofpages<@min+@noofshowpage) set @max=@noofpages else set @max=@min+@noofshowpage end else begin if(@noofpages>@min-@noofshowpage) set @max=@noofpages else set @max=@min-@noofshowpage end end else begin if(@Currentpage>5) begin set @min=(@Currentpage/@noofshowpage)*@noofshowpage set @max=@min+@noofshowpage end else begin set @min=1 set @max=5   end end select @min,@max while(@min<=@max) begin if(@min%@noofshowpage=0 and @Currentpage>4 and @min!=@max)  set @result=@result+'<td><a href=javascript:void(0); title="'+cast(@min-1 as varchar)+'"class="pagelink">Previ...

Paging in ASP DOT Net With MS SQL Database

Data base create table tblCustomer([CustomerID]   int identity(1,1)              ,[CompanyName]   varchar(100)              ,[ContactName]  varchar(100)              ,[ContactTitle]  varchar(100)              ,[Address]   varchar(100)              ,[City]  varchar(100)              ,[Region]  varchar(100)              ,[PostalCode]  varchar(100)              ,[Country]  varchar(100)              ,[Phone]  varchar(100)              ,[Fax]  varchar(100)  )          ------------- insert into tblCustomer ( CompanyName,ContactName,ContactTitle,Ad...