How to use Oracle's ODP. NET to create an object data model

Source: Internet
Author: User

In the VS2010 development environment, we recommend that you use a third-party plug-in to connect to the database.OracleConnection Tool. There are many third-party plug-ins, such as dotconnect for oracle,ODP. NETAnd so on. In this article, we use Oracle's own ODP. NET to connect to the Oracle Data Source. Now ODP. NET can also supportEntity Data ModelEntity Framework ).

The database uses oracle 11G X86 and downloads two files from the oracle Official Website: win32_11gR2_database_1of2 and win32_11gr2_database204 F2.

You also need to download a set of oracle tools for. NET development, such as ODP. NET. The ODAC1120230Beta_EntityFramework file contains all the plug-ins. Install all.

Copy the tnsnames file in D: \ app \ milo \ product \ 11.2.0 \ client_1 \ Network \ Admin \ Sample to D: in the \ app \ milo \ product \ 11.2.0 \ client_1 \ Network \ Admin \ directory, edit the file, for example, according to your own DB Configuration:

 
 
  1. <data source alias> =  
  2.  
  3. (DESCRIPTION =  
  4.  
  5. (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))  
  6.  
  7. (CONNECT_DATA =  
  8.  
  9. (SERVER = DEDICATED)  
  10.  
  11. (SERVICE_NAME = orcl)  
  12.  
  13. )  
  14.  

Save the settings and create a connection to the service resource manager in.

Connection string:

 
 
  1. DATA SOURCE=  
  2.  
  3. (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=orcl)));  
  4.  
  5. PERSIST SECURITY INFO=True;  
  6.  
  7. USER ID=SCOTT 

In this way, you can directly create a data model through this connection.

This section describes how to use ODP. NET to connect to a database and create an object data model.

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.