ASP.NET中使用FCKEditor.net,前台页面实现信息分页的问题
来源:百度知道 编辑:UC知道 时间:2024/09/28 11:48:57
你可以用aspnetpage控件,veryeasy解决分页问题。
ALTER proc p_productsAspNetPage
(
@PageSize int,--每页显示几条
@curPage int , --当前页码
@cID int, --当前产品类别ID
@pcID int
)
as
declare @startID int --每页开始ID号
declare @endID int --每页结束ID号
set @endID=@curPage*@PageSize
set @startID=@endID-@PageSize+1
create table #t
(
tID int identity(1,1) primary key,
pID int --回贴ID
)
if(@cID>0)
begin
insert into #t
select pID from products
where cID = @cID and pcID=@pcID order by pID desc --某1个类别下的 所有产品ID 放进临时表
end
else
begin
insert into #t
select pID from products where pcID=@pcID order by pID desc
end
select #t.tID,p.pID,p.pName,p.cID,p.pPicture,p.fDate,p.pCount,p.price,p.pcID,p.pcID
from products as p --连接2张表
join #t on p.pID=#t.pID
where #t.tID between @startID and @endID order by fDate desc --分页查询