c# - Paged ASP.NET repeater -


i have database full of thousands of products , querying pull large set of data each time different query ran. worry once project goes live , more , more people start hitting site, performance take hit. cant increase power server love solution save me hassle down road. there way of loading sets in sql query?

select top 20 xxx select next 20  

i'm not sure.

by using new function provided sql server 2005 row_number() can result set row number.this row number can used paging on database side.

create procedure [dbo].[getcust]     @pageindex int,      @pagesize int,     @searchkey varchar(255),     @totalrecords int output   if exists(select * tbcustomer  cust_firstname= @searchkey) begin    select @totalrecords =count(*)  tbcustomer cust_firstname= @searchkey;    customer (      select  row_number() on (order cust_firstname asc) row,          cust_id, cust_firstname,address,phone      tbcustomer cust_firstname= @searchkey   )   select cust_id,cust_firstname,address,phone customer    row between (@pageindex - 1) * @pagesize + 1 , @pageindex*@pagesize   end 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -