C # .NET common rights management system component polyepitopic tab large data acquisition method reference column portion

 We often develop a variety of information systems, but do not simply read data from a table, is likely to be read after data from multiple tables, the results are displayed on the screen, when faced with two associated large table, If technically did not do something with that page display speed will be very bad, in the general assembly of the rights management system, a special page is optimized for large data, the following code is a specific implementation.

#region private void DoSearch() 获取列表
    /// <summary>
    /// 获取列表
    /// </summary>
    private void DoSearch()
    {
        string searchValue = this.txtSearch.Text;
        // 总记录数量
        int recordCount = 0;
        BaseManager manager = new BaseManager(this.DbHelper, this.UserInfo, "KEYPROJECT");
        // 这个是需要显示的字段
        manager.SelectField = "ZPResumeInfo.ID, ZPResumeInfo.A0101, ZPResumeInfo_Remark.Remark";
        // 这个是2个表的关联
        manager.CurrentTableName = "ZPResumeInfo INNER JOIN ZPResumeInfo_Remark ON ZPResumeInfo.ID = ZPResumeInfo_Remark.ResumeID";
        // 这个是数据过滤条件
        string whereConditional = " ZPResumeInfo.CreUser = " + this.UserInfo.Id;
        // 这个是排序顺序
        string order = "ZPResumeInfo_Remark.ModifiedOn DESC";
        DataTable dataTable = manager.GetDataTableByPage(out recordCount, this.myNavigator.PageIndex + 1, this.myNavigator.PageSize, whereConditional, order);
        dataTable.DefaultView.Sort = this.SortExpression + " " + this.SortDire;
        // 绑定分页控件
        this.myNavigator.RowCount = recordCount;
        this.myNavigator.BindData(this.gridView, dataTable);
        // 按钮状态控制
        this.SetControlState();
    }
    #endregion


The above example code is from 2 to the table, paging of large data show the effect of reference, to imitate the above code can create your own data you need.

 

 

 

Reproduced in: https: //my.oschina.net/iwenr/blog/227670

Guess you like

Origin blog.csdn.net/weixin_34415923/article/details/91674682