Stored procedure generic DAL class querying paging data back to DataTable

Source: Internet
Author: User

DAL


#region Querying paging Data public DataTable selectpageing (string feids, int page, int pagesize, int paixu, string where, Strin G Paixufeids, String tablename) {sqlparameter[] parms = new sqlparameter[] {new Sqlparamet ER ("@FEILDS", sqldbtype.nvarchar,1000), New SqlParameter ("@PAGE_INDEX", sqldbtype.int,10), new Sqlpara Meter ("@PAGE_SIZE", sqldbtype.int,10), New SqlParameter ("@ORDERTYPE", sqldbtype.int,2), new Sqlparamet ER ("@ANDWHERE", sqldbtype.varchar,1000), New SqlParameter ("@ORDERFEILD", sqldbtype.varchar,100), new S Qlparameter ("@TABLENAME", sqldbtype.varchar,100)}; Parms[0]. Value = feids;//gets all fields parms[1]. Value = page;//Current page index parms[2]. Value = pagesize;//page size parms[3]. Value = paixu;//in ascending order Parms[4]. Value = where;//conditional statement parms[5]. Value = paixufeids;//sort field parms[6]. Value = tablename;//table name DataTable dt = nEW DataTable (); using (SqlDataReader SDR = DBTool.DB.ExecuteReader (CommandType.StoredProcedure, "pagination", parms)) { Dt. Load (SDR); } return DT; } #endregion



Bll

#region  Querying paging data public        DataTable selectpageing (string feids, int page, int pagesize, int paixu, string where, Strin G Paixufeids, String tablename)        {            return new HZ. DAL. Selectpage (). Selectpageing (Feids,page,pagesize,paixu,where,paixufeids,tablename);        }        #endregion

  

Stored procedure generic DAL class querying paging data back to DataTable

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.