Example Analysis of .NET paging Control
This article mainly introduces the example analysis of .NET paging control, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.
This program takes the ado.net used by the data. First, create a new class PageDAl that fetches the data.
Using System;using System.Collections.Generic;using System.Configuration;using System.Data;using System.Data.Common;using System.Data.SqlClient;using System.Linq;using System.Web;namespace page.DAL {public class PageDal {public DataTable GetUserList (out int totalCount, int pageIndex = 1, int pagesize = 10) {using (SqlConnection coon = new SqlConnection (ConfigurationManager.ConnectionStrings ["userConnection"] .ConnectionString)) {coon.Open () String sqlCount = "select count (F_Id) from Sys_User"; SqlCommand cmd = new SqlCommand (sqlCount, coon); totalCount = int.Parse (cmd.ExecuteScalar (). ToString ()); string sql = "select Fairname from (select *, Row_Number () over (order by F_Account) r from Sys_User) as w where r > {0} and r