Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of .NET paging Control

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report