[Vsts] enables ADO. NET Entity Framework to support Oracle databases

Source: Internet
Author: User
Tags oracle developer

Address: http://www.cnblogs.com/WilsonWu/archive/2011/12/16/2290110.html

 

Recently, I had to study the Oracle database because of the need of the project. I think back to the last time I used Oracle for years. During my internship, BMW Brilliance's project had a simple access to Oracle. This project needs to be based on the. NET platform. My personal habit is that I can use the built-in functions of Microsoft without a third party. Based on this principle, I first thought of the orm model as the Entity Framework, so I tried it.

In Visual Studio 2010 by default. the Entity Framework in the. Net project template and type template does not support Oracle databases. I found some third-party plug-ins in a circle, but it was not satisfactory after I tried it, oracle also has some official tools that can be extended to enable Entity Framework to support Oracle databases. Next, let's briefly talk about it.

First, you can prepare two items on the Oracle Official Website:

1. odac 11.2 release 3 (11.2.0.2.1) with Oracle Developer Tools for Visual Studio

: Http://www.oracle.com/technetwork/developer-tools/visual-studio/downloads/index.html

2. Oracle Data Access Components (odac) for Microsoft Entity Framework and LINQ to entities

: Http://www.oracle.com/technetwork/topics/dotnet/downloads/oracleefbeta-302521.html

Note: No matter whether your operating system is 32-bit or 64-bit, the developer only installs 32-bit, because vs is a 32-bitProgramIt should be noted that 64-bit installation is still unavailable.

In addition, the Oracle official website wants to register a user.

After the environment is installed, we can use it:

1. Open Visual Studio 2010 and the project to use Entity Framework:

2. Select the new item in the test project:

3. Select the ADO. Net Object Data Model:

4. Select a database in the pop-up Wizard:

5. You can see the Oracle option in the new connection in step 2. If this item does not prove that the above tool is not installed, check it again:

5. Select the Oracle database and enter the database configuration information:

6. After the connection test is successful, you can confirm and complete the database configuration, and save the connection string:

7. Select the table for which the object is to be generated:

8. You can see that the same entity model is created with the SQL Server database:

Now you can write the program you want. I hope the above content will help you. Thank you!

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.