惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
P
Palo Alto Networks Blog
大猫的无限游戏
大猫的无限游戏
量子位
S
Secure Thoughts
博客园 - 【当耐特】
V
Visual Studio Blog
腾讯CDC
爱范儿
爱范儿
Webroot Blog
Webroot Blog
The Register - Security
The Register - Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Latest news
Latest news
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Cloudbric
Cloudbric
T
Troy Hunt's Blog
S
Security @ Cisco Blogs
B
Blog RSS Feed
I
Intezer
S
SegmentFault 最新的问题
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
C
CXSECURITY Database RSS Feed - CXSecurity.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
TaoSecurity Blog
TaoSecurity Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Recorded Future
Recorded Future
Google DeepMind News
Google DeepMind News
Forbes - Security
Forbes - Security
雷峰网
雷峰网
博客园 - 司徒正美
C
Cisco Blogs
S
Securelist
L
LINUX DO - 最新话题
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
N
News | PayPal Newsroom
N
News and Events Feed by Topic

博客园 - tiger8000

winserver2012 下安装 sqlserver2008 sql 实现学生成绩并列排名算法 asp.net 一次性提交大量数据,服务器会报错,要在 web.config 中设置一下 同一服务器上多个版本的 sqlserver ,如何连接,改变某一实例的端口号 安装SQl 2008为SQL Server代理服务提供的凭据无效 winserver2008 R2 64位 企业版 , IIS 配置运行 asp+access 网站 根据不同分辨率加载不同 css 样芪表 获取屏幕分辩率及客户端信息 用 javascript 脚本,网站判读来访者是手机还是电脑 Lodop6 以上打印控件使用,详参考自带说明文档,打印样式及文字大小要特殊设置一下 win7操作系统32位或是64位系统上安装 sql2005 点滴 在后台 .cs 中执行前台的js 函数 oracle 11g 及 plsqldeveloper 相关操作 窗体程序 防止重复打开子窗体 asp 下 ewebeditor 上传图片功能,在IE7,IE8 及更高版本上失效解决方法 StringBuilder 在后台动态输出 html 代码 Oracle 建表空间 起动停止 Oracle11g 三个服务的批处理写法 C# 捕捉键盘事件
如何使用 aspnetpager
tiger8000 · 2014-07-16 · via 博客园 - tiger8000
<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>

  <webdiyer:AspNetPager id="AspNetPager1" runat="server" ShowPageIndexBox="Always" 
                                            PageSize="20" OnPageChanged="AspNetPager1_PageChanged" 
                                            TextBeforeInputBox="转到第  " 
              TextAfterInputBox="  页  " ShowPageIndex="False" 
                                            ShowInputBox="Always" 
              ShowCustomInfoSection="Left" PrevPageText="上一页" 
                                            NextPageText="下一页" LastPageText="尾页" 
              FirstPageText="首页" AlwaysShow="True" 
                                            CustomInfoSectionWidth="600" 
              CustomInfoTextAlign="NotSet" LayoutType="Table">
      </webdiyer:AspNetPager>


    
        <webdiyer:AspNetPager ID="AspNetPager2" runat="server" CloneFrom="AspNetPager1">
        </webdiyer:AspNetPager>
 public void checkCase()
        {
            string strSql = " ID>0";
            int num = bll.GetRecordCount(strSql);
            AspNetPager1.RecordCount = num;
            DataSet ds = bll.GetAspNetPagerDataSet(strSql, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);
            if (ds.Tables[0].Rows.Count > 0)
            {
                this.Repeater1.DataSource = ds.Tables[0].DefaultView;
                this.Repeater1.DataBind();

                AspNetPager1.CustomInfoHTML = "共:<font color=\"red\"><b>" + AspNetPager1.RecordCount.ToString() + "</b></font>&nbsp;&nbsp;条记录";
                AspNetPager1.CustomInfoHTML += " 总页数:<font color=\"red\"><b>" + AspNetPager1.PageCount.ToString() + "</b></font>&nbsp;&nbsp;页";
                AspNetPager1.CustomInfoHTML += " 每页显示:<font color=\"red\"><b>" + AspNetPager1.PageSize.ToString() + "</b></font>&nbsp;条";
                AspNetPager1.CustomInfoHTML += " 当前页:<font color=\"red\"><b>" + AspNetPager1.CurrentPageIndex.ToString() + "</b></font>&nbsp;&nbsp;";
            }
        }

 bll 

/// <summary>
        /// 获得aspnetpager分页数据
        /// </summary>
        public DataSet GetAspNetPagerDataSet(string whereSql, int mypageindex, int mypagesize)
        {
            return dal.GetAspNetPagerList(whereSql, mypageindex, mypagesize);
        }

DAL

 /// <summary>
        /// 获得AspNetPager分页数据列表
        /// </summary>
        public DataSet GetAspNetPagerList(string strWhere, int mypageindex, int mypagesize)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append(" SELECT ID,sTitle,sContent,sAuthor,sAuthorTel,sAuthorQQ,sAuthorEmail,toDepart,ifPass,PubDate ");
            strSql.Append(" FROM QuestionBook ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by ID desc");
            return SQLHelper.ExecuteWebDiyerDataset(SQLHelper.DBCONNECTIONSTRING, CommandType.Text, strSql.ToString(), mypageindex, mypagesize);
        }

DBTtility

 #region 为webdiyer分页控件做的 DataSet 传递参数进来 DataSet ExecuteWebDiyerDataset(string connString, CommandType cmdType, string cmdText,int mypageindex,int mypagesize, params SqlParameter[] cmdParms)
        public static DataSet ExecuteWebDiyerDataset(string connString, CommandType cmdType, string cmdText, int mypageindex, int mypagesize, params SqlParameter[] cmdParms)
        {
            SqlDataAdapter myAdapter = new SqlDataAdapter();
            myAdapter.SelectCommand = new SqlCommand();

            using (SqlConnection conn = new SqlConnection(connString))
            {
                PrepareCommand(myAdapter.SelectCommand, conn, null, cmdType, cmdText, cmdParms);
                DataSet ds = new DataSet();
                myAdapter.Fill(ds, mypagesize * (mypageindex - 1), mypagesize, "dtable");
                myAdapter.SelectCommand.Parameters.Clear();
                return ds;

            }

        }
        #endregion