Build. NET applications on the Oracle database

Source: Internet
Author: User
Welcome to the Oracle community forum and interact with 2 million technical staff. NET Framework is becoming increasingly popular, and many developers are eager to learn about. the best way to integrate a. NET application with Oracle-not only in terms of basic connectivity, but also in terms of using Visual Studio. NET (. NET ).

Welcome to the Oracle community forum and interact with 2 million technical staff> enter Microsoft. NET Framework is becoming increasingly popular, and many developers are eager to learn about. NET application and Oracle integration the best way to information-not only in terms of basic connectivity, but also with the use of Visual Studio. NET (. NET ).

Welcome to the Oracle community forum and interact with 2 million technical staff> enter

With Microsoft's. NET Framework is becoming increasingly popular, and many developers are eager to learn about. NET application and Oracle integration the best way to information-not only in terms of basic connectivity, but also with the use of Visual Studio. NET (.. NET.

In this article, I will illustrate the basic but indispensable process involved in building. NET applications using Oracle databases, including:

  • How to add project references to support Oracle classes in your. NET project
  • How to create an Oracle database connection string
  • How to Use the Connection, Command, and DataReader objects.
You will have the opportunity to apply the content you learned from the three machine operations practices, and the difficulty ranges from easier to more complex.

. NET Data Provider

In addition to the basic Oracle client connectivity software,. NET applications also need to use tools called managed data provider (where "managed" refers to the management of code by the. NET Framework. The data provider is the layer between the. NET application code and the Oracle client connectivity software. In almost all cases, the optimal performance is achieved by using a supplied program optimized for a specific database platform rather than a general. net ole db data supply program.

Oracle, Microsoft, and third-party vendors provide data supply programs optimized for Oracle products. Oracle and Microsoft provide their Oracle data providers for free. (Microsoft supplies for the. NET Framework Version 1.1 are included in the Framework and do not need to be downloaded or installed separately .) Some third-party data providers support earlier versions of Oracle, or do not need to install the Oracle client software. In this article, we assume that Oracle Data Provider for. NET (ODP. NET) is used and the download is provided separately.

When ODP. NET and all required Oracle client connectivity software are installed, you can start to use Visual Studio. NET for application development. Before starting development, check the client connectivity. If you use SQL * Plus on the computer where VS. NET is located to connect to Oracle, it proves that you have correctly installed and configured the Oracle client software.

If you are new to Oracle, see Oracle Data Provider.. NET developer guide 10g version 1 (10.1) in the "connect to Oracle Database" section to learn about ODP. for more information, see Oracle Database Administrator guide version 10g 1 (10.1. You can also refer to the sample code "method" document "connecting to Oracle Database Using ODP. NET.

Create a project in Visual Studio. NET

After VS. NET is started, the first task is to create a project. You can click the New Project button or SELECT File | New | Project... (as shown below ).

Figure 1: Create a new project in Visual Studio. NET

A New Project dialog box is displayed. Under Project Types on the left side of the dialog box, select your programming language. In this example, we select VB. NET. Under Templates on the right, select a project template. For simplicity, select Windows Application.

Figure 2: Use the New Project dialog box

You will need to specify a meaningful name for the project (we use OtnWinApp) and solution (we use OtnSamples. A solution contains one or more projects. When a solution contains only one project, many people use the same name for the two.

Add reference

Because our project must be connected to the Oracle database, we must add a reference to the dll that contains the selected data supply program. In Solution Explorer, right-click the References node and choose Add Reference. Alternatively, you can go to the menu bar, select Project, and then select Add Reference.

Figure 3: Add a reference

The Add Reference dialog box is displayed.

Figure 4: select the data provider managed by ODP. NET

Select Oracle. DataAccess. dll from the list, click the Select button, and then click the OK button, so that your project can find the ODP. NET data provider.

Figure 5: solution browser after Oracle Managed Provider is selected

[1] [2] [3] [4]

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.