Simply say Winform's paging rapid development Framework one of several functions that must be implemented

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.