. NET+EF Connect Oracle 10, 11 development, ODAC installation configuration and use detailed

Source: Internet
Author: User
Tags oracle developer

Oracle Data Access Component (ODAC) Full name: Oracle Access Components

Advantages: Because Microsoft will System.Data.OracleClient.dll deprecated in. NET Framework4, and in terms of access efficiency and speed, System.Data.OracleClient.dll Oracle.DataAccess.dll, Microsoft does not have the advantage of Oracle's class library, so I gave up the use of System.Data.OracleClient.dll for many years and replaced it with Odp.net.

1. Installation of ODAC

Server side: 0racle10g,11g All right

Client: oracle11g, I downloaded ODAC 11.2 release 5 and Oracle Developer Tools for Visual Studio (11.2.0.3.20), oracle10g can be installed, but there is a lack of custom The corresponding object of the type, and only support vs2003 and vs2005, so I chose to use the oracle11g version ODAC 11.2 Release 5 and Oracle Developer Tools for Visual Studio (11.2.0.3 .20), download address http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html

2. Setting of environment variable

(1) New ORACLE_HOME:ODAC installation directory (similar to ~app\administrator\product\. 1.0\client_1, my installation directory here is G:\app\Administrator\product\ 11.2.0\client_2)

Note: This is NULL for this machine to install Oracle server, otherwise the listening service will not start, Plsql Developer Connection exception.

(2) New ld_library_path:%oracle_home% (If Linux)

(3) New tns_admin:%oracle_home% (here is the listening settings, should be Tnsnames.ora directory, I set is G:\oracle\product\10.2.0\db_1\NETWORK\ADMIN, Of course, you can also copy the configured Tnsnames.ora file into the%oracle_home% directory.

(4) Append to the front of PATH:%oracle_home% (automatically append after installing ODAC)

(5) If plsql Developer cannot connect to Oracle, set the Oracle home directory name for plsql Developer :

Tools-> Preferences


Establish a connection with Oracle in 3.vs2010

In the VS menu bar, click View-> Server Explorer, select the data connection in the Server Explorer panel, and right-click to add a connection


Click the Change button on the data source to select the Oracle database, data provider, and Oracle Date Provider for.net in the pop-up change data source box.

Select the data source name in the Drop-down list box for the data source name, the name of which is configured in Tnsnames.ora, enter username password, click OK to establish vs Oracle connection.

Finally, you can use the tools here to operate the Oracle database, including complex custom object classes to establish specific operations see "Pro odp.net for Oracle database11g" chapter 14th Odt.net Tool Basics

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.