zoukankan      html  css  js  c++  java
  • 本人自写代码(Aspnetpager详细介绍)

    DataSet ds;
        SqlDataAdapter dr;
        SqlCommand com;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["shanxiConnectionString"].ConnectionString);
                com = new SqlCommand("select count(*) from Artist",con);
                con.Open();
                AspNetPager1.RecordCount=(int)com.ExecuteScalar();
           
                con.Close();
                bind();
            }
        }

        public void bind()
        {


            int count = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize;
            SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["shanxiConnectionString"].ConnectionString);
            dr = new SqlDataAdapter("select * from Artist", con);
            ds = new DataSet();
            dr.Fill(ds, count, AspNetPager1.PageSize, "Artist");
          
            GridView1.DataSource = ds.Tables["Artist"];
            GridView1.DataBind();
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            bind();
        }

  • 相关阅读:
    CSP201412-2:Z字形扫描
    CSP201409-2:画图
    CSP201403-2:窗口
    CSP201312-2:ISBN号码
    CSP201709-1:打酱油
    CSP201703-1:分蛋糕
    CSP201612-1:中间数
    LOAM笔记及A-LOAM源码阅读
    特征值、特征向量与PCA算法
    欧几里得与区域生长算法
  • 原文地址:https://www.cnblogs.com/chenbg2001/p/1709475.html
Copyright © 2011-2022 走看看