Asp.net data volume operations

Source: Internet
Author: User

Using system; <br/> using system. collections. generic; <br/> using system. LINQ; <br/> using system. text; <br/> using datahelp; <br/> using system. data; </P> <p> namespace Dal <br/>{< br/> public class otherdefinedal: dalbase <br/>{< br/> Public static datatable getotherdefine () <br/>{< br/> string SQL = string. format ("select * From DBO. otherdefinea "); <br/> return sqldataaccess. filltable (SQL); <br/>}</P> <p> Public static datatable getotherdefine (int id) <br/>{< br/> string SQL = string. format (@ "select * From otherdefinea where id = @ ID"); </P> <p> sqlparametermanager SPM = new sqlparametermanager (SQL, commandtype. text); <br/> SPM. add ("@ ID", ID); </P> <p> return sqldataaccess. filltable (SPM); <br/>}</P> <p> Public static datatable getotherdefineb (int id) <br/>{< br/> string SQL = string. format (@ "select * From DBO. otherdefineb as B join DBO. otherdefinea as a on B. itemno =. ID where. id = @ ID "); </P> <p> sqlparametermanager SPM = new sqlparametermanager (SQL, commandtype. text); <br/> SPM. add ("@ ID", ID); </P> <p> return sqldataaccess. filltable (SPM); <br/>}</P> <p> Public static int insertotherdefinea (string itemcode, string itemcname, string itemename) <br/>{< br/> string SQL = string. format ("insert into otherdefinea values (@ itemcode, @ itemcname, @ itemename)"); <br/> sqlparametermanager SPM = new sqlparametermanager (SQL, commandtype. text); <br/> SPM. add ("@ itemcode", itemcode); <br/> SPM. add ("@ itemcname", itemcname); <br/> SPM. add ("@ itemename", itemename); <br/> int objrow = sqldataaccess. executenonquery (SPM); <br/> return objrow; <br/>}</P> <p> Public static datatable getmaxid () <br/>{< br/> string SQL = string. format ("select max (ID) from otherdefinea"); <br/> return sqldataaccess. filltable (SQL); <br/>}</P> <p> Public static int insertotherdefineb (INT itemno, string listcode, string Lista, string listb, string listc, string listd, string liste) <br/>{< br/> string SQL = string. format (@ "insert into otherdefineb values (@ itemno, @ listcode, @ Lista, @ listb, @ listc, @ listd, @ liste )"); <br/> sqlparametermanager SPM = new sqlparametermanager (SQL, commandtype. text); <br/> SPM. add ("@ itemno", itemno); <br/> SPM. add ("@ listcode", listcode); <br/> SPM. add ("@ lista", lista); <br/> SPM. add ("@ listb", listb); <br/> SPM. add ("@ listc", listc); <br/> SPM. add ("@ listd", listd); <br/> SPM. add ("@ liste", liste); <br/> int objrow = sqldataaccess. executenonquery (SPM); <br/> return objrow; <br/>}</P> <p> Public static int updateotherdefineb (INT itemno, string listcode, string Lista, string listb, string listc, string listd, string liste) <br/>{< br/> string SQL = string. format (@ "Update otherdefineb set lista = @ Lista, listb = @ listb, listc = @ listc, listd = @ listd, liste = @ liste where itemno = @ itemno and listcode = @ listcode "); <br/> sqlparametermanager SPM = new sqlparametermanager (SQL, commandtype. text); <br/> SPM. add ("@ itemno", itemno); <br/> SPM. add ("@ listcode", listcode); <br/> SPM. add ("@ lista", lista); <br/> SPM. add ("@ listb", listb); <br/> SPM. add ("@ listc", listc); <br/> SPM. add ("@ listd", listd); <br/> SPM. add ("@ liste", liste); <br/> int objrow = sqldataaccess. executenonquery (SPM); <br/> return objrow; <br/>}</P> <p> Public static int deleteotherdefineb (INT itemno, string listcode) <br/>{< br/> string SQL = string. format (@ "delete from otherdefineb where itemno = @ itemno and listcode = @ listcode"); <br/> sqlparametermanager SPM = new sqlparametermanager (SQL, commandtype. text); <br/> SPM. add ("@ itemno", itemno); <br/> SPM. add ("@ listcode", listcode); <br/> int objrow = sqldataaccess. executenonquery (SPM); <br/> return objrow; <br/>}</P> <p> Public static datatable getlistcode (INT itemno, string listcode) <br/>{< br/> string SQL = string. format (@ "select * From DBO. otherdefineb where listcode = @ listcode and itemno = @ itemno "); </P> <p> sqlparametermanager SPM = new sqlparametermanager (SQL, commandtype. text); <br/> SPM. add ("@ listcode", listcode); <br/> SPM. add ("@ itemno", itemno); <br/> return sqldataaccess. filltable (SPM); <br/>}</P> <p> Public static int updateotherdefinea (int id, string itemcode, string itemcname, string itemename) <br/>{< br/> string SQL = string. format (@ "Update otherdefinea set itemcode = @ itemcode, itemcname = @ itemcname, itemename = @ itemename where id = @ ID "); <br/> sqlparametermanager SPM = new sqlparametermanager (SQL, commandtype. text); <br/> SPM. add ("@ ID", ID); <br/> SPM. add ("@ itemcode", itemcode); <br/> SPM. add ("@ itemcname", itemcname); <br/> SPM. add ("@ itemename", itemename); </P> <p> int objrow = sqldataaccess. executenonquery (SPM); <br/> return objrow; <br/>}</P> <p> Public static int deleteotherdefinea (int id) <br/>{< br/> string SQL = string. format (@ "delete from otherdefinea where id = @ ID"); <br/> sqlparametermanager SPM = new sqlparametermanager (SQL, commandtype. text); <br/> SPM. add ("@ ID", ID); </P> <p> int objrow = sqldataaccess. executenonquery (SPM); <br/> return objrow; <br/>}</P> <p> Public static int deleteallotherdefineb (INT itemno) <br/>{< br/> string SQL = string. format (@ "delete from otherdefineb where itemno = @ itemno"); <br/> sqlparametermanager SPM = new sqlparametermanager (SQL, commandtype. text); <br/> SPM. add ("@ itemno", itemno); </P> <p> int objrow = sqldataaccess. executenonquery (SPM); <br/> return objrow; <br/>}</P> <p >}< br/>

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.