Referring to a multi-master article, it is mainly to find that the most important is to use the stored procedure to process, return to the DataSet of the current page data. Stored as follows: CREATE PROCEDURE dbo.sp_info_page2 (@pagesize int, @ currpage int) asbeginDECLARE @sqlText AS nvarchar (4000) if (@ currpage = 1) set @ sqlText = 'select top' CAST ((@ pagesize) as varchar (30)) '* from TBL_INFO ORDER by Infoid Desc'lse Set @ Sqltext =' SELECT TOP ' CAST ((@ Pagesize) As Varchar (30)) ' * from TBL_INFO WHERE (Infoid <(SELECT MIN) ) From (SELECT TOP ' CAST ((@ pagesize * (@ price)) AS VARCHAR (30)) ' Infoid from TBL_INFO ORDER BY Infoid DESC) AS T: ORDER BY Infoid DESC '
EXEC (@sqltext) Endgo Among them, the main idea reference http://blog.9cbs.net/lihonggen0/archive/2004/09/14/103511.aspx's second solution. Considering that most content need to be reversed to the ID field, the stored procedure has been modified. After the Dataset returned by the stored procedure, you only need to control the paging lasers. First read the sum of the entire entire data, the total number of acquisitions, then follow the page size to get the page pagination navigation string. strPageControl = " Home "; if (! intCurrPageNo = 1) strPageControl = strPageControl " Previous "; else strPageControl = strPageControl "Previous";! if (intCurrPageNo = intPageCount) {strPageControl = strPageControl " Next page "; strpagecontrol = strpagecontrol Last page "} Else {strpageControl = strpageControl " Next Last ";} Please teach yourself.