2011-03-17 Free Oracle client-side remote Oracle method

Source: Internet
Author: User
Tags oracleconnection

1, http://www.oracle.com/technetwork/topics/winsoft-085727.html download the corresponding version of the Instanctclinet Zip package 34M decompression after 92M To select a non-32-bit operating system, find http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

2. Unzip the 9 files in the package into the System32 directory

3. Add System.Data.OracleClient Reference

4, using System.Data.OracleClient 5, string connectionString = "Data source= (DESCRIPTION = (Address_list = (ADDRESS = (P Rotocol = TCP) (HOST = 202.149.225.122) (PORT = 1521))) (Connect_data = (service_name = pub))); User id= Lahom; Password = JJ; Unicode=true; "; Unicode=true is the key to ensure that Chinese characters do not appear garbled!!

OracleConnection cnn = new OracleConnection (connectionString);

Cnn. Open ();

OracleCommand cmd = cnn. CreateCommand ();

Cmd.commandtext = ("SELECT * from AD");

OracleDataAdapter Myda = new OracleDataAdapter (cmd);

DataSet myds = new DataSet ();

Myda. Fill (myds);

MessageBox.Show (myds. Tables[0]. Rows[0]. ITEMARRAY[2]. ToString ());

2011-03-17 Free Oracle client-side remote Oracle method

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.