Connect to Oracle DB via Visual Studio

If you decide to connect to Oracle DB using Visual Studio you should follow the mentioned instruction below:

  • Make sure that the Instance Oracle Client and Oracle Data Provider for .Net (x64) have been installed. (To download and install Instance Oracle Client and Oracle Data Provider check this )
  • Open Visual Studio > Tools Menu > Select Connect to Database.

ConnecttoDB

  • Here’s the following “Choose Data Source” dialog  should shown.

ConnectDB2

  • Select Oracle DB and for data provider select .Net Framework Data Provider for Oracle > Click Continue.
  • Here’s the following “Add Connection” dialog should shown.

connectDB4

By the way, I wrote this hint to explains How to fill the Server name in “Add Connection” dialog by following the bit steps below :

  • Locate the Oracle Installation path, Check “tnsnames.ora” file.
    • Note : If  tnsnames.ora file was not found so that
      • Go to Sample Folder > Copy tnsnames.ora file and paste it outside Sample folder.
  • Write the connection string as mentioned below.
    • Where PROD is the Server name in “Add Connection” dialog.
    • Update Host with your IP.
PROD=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.200.100) (PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME =ERP)
)
)
  • Go back to “Add Connection” dialog and Set Server name and provide the Username and Password > Test Connection > OK.

connectDB3

  • Now the Oracle connection should be established successfully.

Enjoy 🙂

Advertisements

One thought on “Connect to Oracle DB via Visual Studio

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s