The official website also provides a storage process generation tool. You can write it by yourself here. By the way, you can learn the syntax of the stored procedure: Copy code 1 create proc Paged 2 @ pageIndex INT, 3 @ pageCount int output, 4 @ pageSize INT 5 AS 6 DECLARE @ count INT 7 SELECT @ count = COUNT (*) FROM dbo. student 8 SET @ pageCount = CEILING (@ count * 1.0/@ pageSize) 9 SELECT 10*11 FROM 12 (SELECT ROW_NUMBER () OVER (order by dbo. student. stuId) AS tempId, * FROM dbo. student) AS stu13 WHERE tempId >=@ pageSize * (@ pageIndex-1) + 1 AND tempId <= @ pageIndex * @ pageSize copy Code introduce components in the page: <% @ Register Assembly = "AspNetPager" Namespace = "Wuqi. webdiyer "TagPrefix =" webdiyer "%> paging style 1: Copy code 1 from the last page of the previous page of the homepage <webdiyer: aspNetPager ID = "AspNetPager1" runat = "server" 2 CustomInfoHTML = "% PageCount % page in total, currently % CurrentPageIndex % PAGE, % PageSize % per page, % RecordCount % Total "3 FirstPageText =" Homepage "4 LastPageText =" last page "5 NextPageText =" next page "6 PageIndexBoxType =" TextBox "7 PrevPageText =" Previous Page "8 ShowCustomInfoSection = ""Left" 9 ShowPageIndex = "False" 10 ShowPageIndexBox = "Always" 11 SubmitButtonText = "Go" 12 SubmitButtonClass = "right_d_btn" 13 placement = "page" 14 TextBeforePageIndexBox = "Go" 15 OnPageChanging = "AspNetPager1_PageChanging" 16 AlwaysShow = "True" 17 PageSize = "10" 18 ShowMoreButtons = "false" 19 HorizontalAlign = "Center"> 20 </webdiyer: aspNetPager> result 2: Code 1 <form id = "form1" runat = "server"> 2 <asp: gridview runat = "server" ID = "gridStudent"> </asp: gridview> 3 <div> 4 <% -- paging style 2 default mode 1 2 3 4 5 6 7... -- %> 5 6 <webdiyer: AspNetPager ID = "AspNetPager1" runat = "server" PageSize = "5" 7 OnPageChanging = "AspNetPager1_PageChanging"> 8 </webdiyer: aspNetPager> 9 </div> 10 </form>