Beispiel #1
0
        //GridView不能重写DataBind
        /// <summary>
        /// 生成数据源,在任何设置完成后,DataBind()之前执行
        /// </summary>
        public void CreateDataSource()
        {
            string recordCountSql = query.CreateGetRecordCountSql();

            this.pager.RecordCount = db.ExecuteScalar(recordCountSql).ToArrowInt();
            pager.CaculatePageCount();
            string pageSql = query.CreatePagerSql(db.ProviderName, pager);

            this.DataSource = db.ExecuteDataSet(pageSql);
        }
Beispiel #2
0
 public override void DataBind()
 {
     if (!DesignMode)
     {
         string recordCountSql = query.CreateGetRecordCountSql();
         this.pager.RecordCount = db.ExecuteScalar(recordCountSql).ToArrowInt();
         pager.CaculatePageCount();
         string pageSql = query.CreatePagerSql(db.ProviderName, pager);
         this.DataSource = db.ExecuteDataSet(pageSql);
     }
     base.DataBind();
 }