The SQL Server data is displayed in pagination.

Source: Internet
Author: User

1 Select[ID]2 , [Stockapplycode]3 , [Rccode]4 , [Labcentercode]5 , [Labgroupcode]6 , [Labgroupname]7 , [Barcode]8 , [Testsubitemcode]9 , [Testsubitemname]Ten , [CreateDate] One , [Calcrule] A , [Bomtype] - , [Bomconsume] - , [singleconsumepredict] the , [Singleconsume] - , [begindate] - , [EndDate] - , [Costprice] + Into #tempRCUDCalc -   fromFinancial.reagentconsumablesusedetailcalc +  whereStockapplycode =@StockApplyCode A  atDECLARE @TotalRowCount INT--total number of rows -SET @TotalRowCount = (SelectCOUNT (1) from #tempRCUDCalc) -  -DECLARE @tempint -  Set@[email protected]* (@PageIndex-1) -  SelectTop (Select@PageSize) in [ID] - , [Stockapplycode] to , [Rccode] + , [Labcentercode] - , [Labgroupcode] the , [Labgroupname] * , [Barcode] $ , [Testsubitemcode]Panax Notoginseng , [Testsubitemname] - , [CreateDate] the , [Calcrule] + , [Bomtype] A , [Bomconsume] the , [singleconsumepredict] + , [Singleconsume] - , [begindate] $ , [EndDate] $ , [Costprice] ---, @TotalRowCount totalrowcount -   from#tempRCUDCalc A the  whereNot EXISTS ( -SELECT1  from(SelectTop (Select@temp) ID from#tempRCUDCalc ORDER by ID) Bwherea.ID =b.idWuyi  ) the ORDER BY ID -   Wu--Results Total Rows -  SelectCOUNT (1) Totalrowcount from #tempRCUDCalc
 Public voidLoadreagentconsumablesuseapplyedit (stringStrapplycode,intPageIndex,intPageSize, out intCounttotal, out intAllrowscount) {Counttotal= +; Allrowscount=0; Try            {                if(PageIndex <=0) PageIndex=1; if(PageSize <=0) PageSize= +; Byte[] Isdata= serviceexecutemethod.executemethod<ifinancial>(Config.readvaluebykey (commonstring.ifinancialurl),"Loadreagentconsumablesuseapplyeditbypage",New Object[] {strapplycode, PageIndex, pageSize}, Config.readvaluebykey (commonstring.ifinancialbinding)) asbyte[]; if(PageIndex = =1) {_reagentconsumablesuse= Dataziphelp.retrievedatasetdecompress (Isdata) asDsreagentconsumablesuse; Counttotal=_reagentconsumablesuse.reagentconsumablesusedetailcalc.count; if(Counttotal >0) Allrowscount=int. Parse (_reagentconsumablesuse.tables["Tableinfo"]. rows[0]["Totalrowcount"].                ToString ()); }                Else{dsreagentconsumablesuse dstemp= Dataziphelp.retrievedatasetdecompress (Isdata) asDsreagentconsumablesuse; if(_reagentconsumablesuse = =NULL)return; Counttotal=DsTemp.ReagentConsumablesUseDetailCalc.Count; if(Counttotal >0) Allrowscount=int. Parse (_reagentconsumablesuse.tables["Tableinfo"]. rows[0]["Totalrowcount"].                    ToString ());                    _reagentconsumablesuse.reagentconsumablesusedetailcalc.merge (DSTEMP.REAGENTCONSUMABLESUSEDETAILCALC);                _reagentconsumablesuse.acceptchanges (); }            }            Catch(Exception ex) {Throwex; }        }   Private voidRefreshreagentconsumablesusedetailcalcdata () {Try            {                //Popup Prompt Screen                NewThread ((ThreadStart)Delegate{waitingdatarefreshing=NewDevExpress.Utils.WaitDialogForm ("Please wait ...","Loading Data",NewSize ( -, +));                Application.Run (waitingdatarefreshing); }).                Start (); _biz.loadreagentconsumablesuseapplyedit (Stockapplycode,++pageindex, PageSize, outCounttotal, outallrowscount); //Tempds = Commonbiz.splitdataset (_biz.reagentconsumablesuse, Tempds, "Reagentconsumablesusedetailcalc", + +                PageIndex, PageSize, out Counttotal, out allrowscount); //Application Details-apportionment_bsreagentconsumablesusedetailcalc.datasource =_biz.reagentconsumablesuse; _bsreagentconsumablesusedetailcalc.datamember="Reagentconsumablesusedetailcalc"; GrdcReagentConsumablesUseDetailCalc.EmbeddedNavigator.TextStringFormat=@"Record {0} of"+allrowscount.tostring ();                Grdvreagentconsumablesusedetailcalc.bestfitcolumns (); //waitdialogform.close ();Waitingdatarefreshing.invoke ((EventHandler)Delegate{waitingdatarefreshing.close ();}); }            Catch(Exception ex) {xtramessagebox.show ("Data load failed! Error message ["+ ex. Message +"]"); }        } Private voidGrdvreagentconsumablesusedetailcalc_toprowchanged (Objectsender, EventArgs e) {            Try            {                if(Grdvreagentconsumablesusedetailcalc.isrowvisible (Grdvreagentconsumablesusedetailcalc.rowcount-1) ==rowvisiblestate.visible) {grdvreagentconsumablesusedetailcalc.toprowchanged-=grdvreagentconsumablesusedetailcalc_toprowchanged; if(Counttotal = = PageSize && allrowscount >counttotal)                        {Refreshreagentconsumablesusedetailcalcdata (); Grdvreagentconsumablesusedetailcalc.toprowchanged+=grdvreagentconsumablesusedetailcalc_toprowchanged; }                }            }            Catch(Exception ex) {Xtramessagebox.show (ex).            Message); }        }
Using Code

The SQL Server data is displayed in pagination.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.