Your search did not match any results.
We suggest you try the following to help find what you’re looking for:
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.
Prerequisites:
Visual Studio 2019, 2017, or 2015
Access to an on-premises Oracle Database. Download Oracle Database.
In Visual Studio, create a new Visual C# "Console App (.NET Framework)".
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:
Add "using Oracle.ManagedDataAccess.Client" to the top of the main C# (Program.cs) file.
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/myservicename.mycompany.com;"
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.
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:
Close any running Visual Studio instance before installing.
If you already have Oracle software installed, install into a new "Oracle Home" software location (i.e. a new subdirectory).
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:
Enter the user name and password.
In the connection type drop down, choose "Basic" or "EZ Connect".
Enter the host name/IP, port number, and service name for the database you wish to connect to.
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.