国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

asp.net 無刷新分頁實例代碼

2024-07-10 12:46:08
字體:
來源:轉載
供稿:網友

數據類代碼:

代碼如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Reflection;

namespace DAL
{
    public  class UserManageClass
    {
        /// <summary>
        /// 取得總頁數
        /// </summary>
        /// <returns>總頁數</returns>
        public int GetPageCount()
        {
            int counts;
            string SqlStr = "select count(0) from [User]";
            counts = new SQLHelper().Content(SqlStr, CommandType.Text);
            return counts;
        }
        /// <summary>
        /// 取出每一頁的內容
        /// </summary>
        /// <param name="SatrPage">開始頁數</param>
        /// <param name="EndPage">結束頁數</param>
        /// <returns>每一頁的內容</returns>
        public DataTable GetPageDate(string SatrPage, string EndPage)
        {
            DataTable dt;
            string SqlStr = @"select * from
            (select *, ROW_NUMBER() over(order by id)as no_ from [User])aa
            where aa.no_ between '"+SatrPage+"' and '"+EndPage+"'";
            dt = new SQLHelper().ExecuteQuery(SqlStr, CommandType.Text);
            return dt;
        }

        /// <summary>
        /// 將一個DataTable轉換成列表
        /// </summary>
        /// <typeparam name="T">實體對象的類型</typeparam>
        /// <param name="dt">要轉換的DataTable</param>
        /// <returns></returns>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 文化| 阳西县| 崇信县| 盱眙县| 德江县| 浦北县| 洛南县| 琼结县| 鹰潭市| 陇南市| 涟水县| 上高县| 兴山县| 惠州市| 蕲春县| 荆门市| 环江| 库伦旗| 洪泽县| 肃北| 海宁市| 桐庐县| 米易县| 云霄县| 务川| 临汾市| 周宁县| 鹤山市| 北票市| 通许县| 卢氏县| 潜江市| 安阳市| 安平县| 衢州市| 龙江县| 郴州市| 大庆市| 宿松县| 长沙县| 肥城市|