No results found

Your search did not match any results.

We suggest you try the following to help find what you’re looking for:

  • Check the spelling of your keyword search.
  • Use synonyms for the keyword you typed, for example, try “application” instead of “software.”
  • Try one of the popular searches shown below.
  • Start a new search.
Trending Questions

Start Developing .NET Oracle Database Apps in 10 Minutes

This tutorial walks you through developing a .NET Framework app for an on-premises Oracle Database and using Oracle tools integrated into Visual Studio. You'll use Oracle Data Provider for .NET (ODP.NET) and Oracle Developer Tools for Visual Studio (ODT).

There are other getting started tutorials available for Oracle Database with .NET Core and Visual Studio Code, as well as .NET for Oracle Database Cloud.

What You Need

Develop Some Code

  • In Visual Studio, create a new Visual C# "Console App (.NET Framework)".

  • In Solution Explorer, right click on your new project and choose "Manage Nuget Packages". When the Package Manager window opens, search online for "Oracle". Select "Oracle.ManagedDataAccess" and then click "Install".
  • Extract this example code zip file into a temporary directory. Find and open the file "Code_Snippet.txt".

  • Paste the code from "Code_Snippet.txt" into the Main() method.

  • Modify the code:

    1. Add "using Oracle.ManagedDataAccess.Client" to the top of the main C# (Program.cs) file.

    2. Modify the connect string to use your database's username, password, host name/IP address, database service name, and port number, for example:  "User Id=myusername; password=mypass; Data Source=myhost:1521/;"

    3. This sample code uses the HR schema's EMPLOYEES table. If you do not have the HR schema in your database, modify the tables and columns in the code to use a table that you do have access to.

  • Build and run the application.

Download and Install Oracle Developer Tools for Visual Studio

  • Oracle Developer Tools for Visual Studio is required to enable Visual Studio data features, such as Server Explorer integration, TableAdapter Configuration Wizard and Entity Designer. It also adds useful Oracle specific features.

  • Download the tools software bundle for your Visual Studio version:

  • Run the setup executable. Note the following important installation details:

    1. Close any running Visual Studio instance before installing.

    2. If you already have Oracle software installed, install into a new "Oracle Home" software location (i.e. a new subdirectory).

Connect to Oracle Database from Visual Studio

  • Open Visual Studio after ODT installation. Right click on Server Explorer's root node and choose "Create New Connection". 

  • In the connection dialog, click the "Change" button to change the data source.

  • Select "Oracle Database" from the list of data sources and "ODP.NET, Managed Driver" from the drop down list. If you do not see it, the installation of Oracle Developer Tools for Visual Studio was not successful. Do NOT select ".NET Framework Data Provider for Oracle". 

  • You will now see Oracle's connection dialog:

    1. Enter the user name and password.

    2. In the connection type drop down, choose "Basic" or "EZ Connect".

    3. Enter the host name/IP, port number, and service name for the database you wish to connect to. 

    4. Press OK to connect. 

  • You can now explore your Oracle Database in Server Explorer and take advantage of many of the Oracle Developer Tools for Visual Studio features.