Simply say Winform's paging rapid development Framework one of several functions that must be implemented
Pagination is not front-end paging and back-end paging, front-end paging is only applicable to the b/s,b/s rendering speed is far less than C/S, and/C does not have this problem, so the paging must be the backend page
Here to explain the WinForm page and Web paging will have a problem: two times (total number of pages, one time to get the current page data)
So paging is the need for data is particularly large when the significance of optimization, such as query 100 data is 1ms query 1000 data is 1.1s if the use of paging, then the time-consuming query is basically 2ms (count the nested query is 3MS), so self-weigh
Control online There's a lot to say
Next SQL (EF's skip)
-------This is an extra query, in order to get the total number of pages
DECLARE @Total INTSELECT @Total = COUNT(0) fromSys_button AWHERE 1 = 1 andA.isdelete= 0 and ISNULL(A.button_name,"') like '%'+ ISNULL(@cButton_Name,ISNULL(A.button_name,"'))+'%' and ISNULL(A.button_nick,"') like '%'+ ISNULL(@cButton_Nick,ISNULL(A.button_nick,"'))+'%' and ISNULL(A.button_hint,"') like '%'+ ISNULL(@cButton_Hint,ISNULL(A.button_hint,"'))+'%' and ISNULL(A.button_sub,"') like '%'+ ISNULL(@cButton_Sub,ISNULL(A.button_sub,"'))+'%'SELECTB.* from(SELECTa.button_id, A.button_name,
----Here is the code that focuses on paging .@TotalPagerecord, Row_number () Over(ORDER byPage_nick,a.button_sort) record_id, (@Total / @PageSize)+ 1PageCount fromSys_button A Left JOINSys_page B onA.button_page=b.page_idWHERE 1 = 1 andA.isdelete= 0 and ISNULL(A.button_name,"') like '%'+ ISNULL(@cButton_Name,ISNULL(A.button_name,"'))+'%' and ISNULL(A.button_nick,"') like '%'+ ISNULL(@cButton_Nick,ISNULL(A.button_nick,"'))+'%' and ISNULL(A.button_hint,"') like '%'+ ISNULL(@cButton_Hint,ISNULL(A.button_hint,"'))+'%' and ISNULL(A.button_sub,"') like '%'+ ISNULL(@cButton_Sub,ISNULL(A.button_sub,"'))+'%') BWHEREb.record_id>(@PageIndex - 1)* @PageSize andb.record_id<=(@PageIndex)* @PageSizeORDER byPage_nick, Button_sort
Simply say Winform's paging rapid development Framework one of several functions that must be implemented