private void LoadData() { string sOrder = GetOrderString() == "" ? "" : " ORDER BY " + GetOrderString(); pages.PageSize = Global.MembersPerPage; HPCBusinessLogic.DAL.TinBaiDAL _T_newsDAL = new HPCBusinessLogic.DAL.TinBaiDAL(); DataSet _ds; _ds = _T_newsDAL.BindGridT_Tulieu(pages.PageIndex, pages.PageSize, BuildSQL(sOrder)); int TotalRecords = Convert.ToInt32(_ds.Tables[1].Rows[0].ItemArray[0].ToString()); int TotalRecord = Convert.ToInt32(_ds.Tables[0].Rows.Count); if (TotalRecord == 0) _ds = _T_newsDAL.BindGridT_Tulieu(pages.PageIndex - 1, pages.PageSize, BuildSQL(sOrder)); DataGrid_tinbai.DataSource = _ds; DataGrid_tinbai.DataBind(); pages.TotalRecords = CurrentPage.TotalRecords = TotalRecords; CurrentPage.TotalPages = pages.CalculateTotalPages(); CurrentPage.PageIndex = pages.PageIndex; }