Beispiel #1
0
    //绑定
    private void BindGridView()
    {
        //try
        //{
        string  sql = Getsqlstr();
        DataSet ds  = QTRKReport.GetQueryYTRK(sql, "", PageControl1.GetPageSize(), PageControl1.GetCurrPage());

        this.grvQTRK.DataSource = ds;
        this.grvQTRK.DataBind();

        //}
        //catch (Exception ex)
        //{
        //    String strEx = ex.Message;
        //    this.PrintfError("数据访问错误,请重试!");
        //}
    }
Beispiel #2
0
 //绑定
 private void BindGridView()
 {
     try
     {
         string  sql        = Getsqlstr();
         string  sortEx     = this.grvQTRK.Attributes["SortExpression"];
         string  sortDirect = this.grvQTRK.Attributes["SortDirection"];
         string  strSort    = (!string.IsNullOrEmpty(sortEx)) ? sortEx + " " + sortDirect : "";
         DataSet ds         = QTRKReport.GetQueryYTRK(sql, strSort, PageControl1.GetPageSize(), PageControl1.GetCurrPage());
         this.grvQTRK.DataSource = ds;
         this.grvQTRK.DataBind();
     }
     catch (Exception ex)
     {
         String strEx = ex.Message;
         this.PrintfError("数据访问错误,请重试!");
     }
 }