Visual Studio connects to the Oracle database

Source: Internet
Author: User
Tags oracleconnection oracle developer

I. Installation of Oracle Developer Tools for Visual Studio 2015

The other client does not install, installed the direct uninstall.

You need to log in when downloading, if you have already registered an account, remind me that password rules need to include both uppercase and lowercase letters and numbers.

Second, modify the Tnsnames.ora file configuration database server

This file is located in the installation directory \network\admin directory, generally only need to modify 4 places: Service Alias, host name (or IP), port number, service name (generally ORCL)

Iii. adding assembly references for. NET projects

Opening VS2015 will find that there are some Oracle-related items in the Tools menu, but this is not the point, and there is no such menu item in VS2017, but it has no effect.

New or open a project, right-click on the reference to add a reference, in the popup dialog box, select "assembly" \ "extension", enter Oracle in the search box, select Oracle.managedataaccess.

Iv. Writing test Code

usingSystem;usingOracle.ManagedDataAccess.Client;//referencing the namespace where the OracleConnection class residesnamespaceoracledemo{Static classProgram {Static voidMain () {using(varConnection =NewOracleConnection ("Data source=test; Persist Security info=true; User Id=user; password=123456;") {connection.                Open (); Console.WriteLine ("connection Success!!! ");        } console.readline (); }    }}

Visual Studio connects to the Oracle database

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.