ADO Extension Properties

Source: Internet
Author: User

1, the class name to expand the same, 2 classes plus (partial)

Small example:

usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingsystem.web;usingSystem.Data;usingSystem.Data.SqlClient;/// <summary>///Stores Extended Properties (extension of one Stores Class)/// </summary> Public Partial classstores{PrivateSqlConnection _conn; PrivateSqlCommand _cmd; PrivateSqlDataReader _dr;  PublicStores () {_conn=Dbconnection.conn; _cmd=_conn.    CreateCommand (); }     Public intlogin_id {Get{_cmd.commandtext="SELECT * from Ims_dish_login where [email protected]_username";//go to another table in query ID _cmd. Parameters.addwithvalue ("@Login_Username", This.            Login_username); _conn.            Open (); _DR=_cmd.            ExecuteReader (); intA =0;  while(_DR. Read ()) {a= Convert.ToInt32 (_dr["login_id"]); } _conn.            Close (); returnA; }    }}

ADO Extension Properties

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.