Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of .NET paging Control

Shulou Source: shulou.com Published: 2022-06-03 12:59:51 11月14日 Update

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

Tags: Data characters articles this is string statement home page control example analysis that is database program page previous character type special next thing two. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB NVidia Apple Redmi Huawei