1

In Visual Studio 2010 I select Add new connection and then I choose Oracle server. Then I choose Oracle provider for .Net, and this window comes.

enter image description here

I wonder what I should write in the Data Source text field if the Oracle database is at a server with name AZSSRV and IP address 172.117.17.1? Any help will be appreciated.

2 Answers 2

2

After getting inspired with @Harrison's answer I finally was able to create a successful connection with Oracle Database located in a remote server. So I did exactly the way Harrison told me -created an environment variable named TNS_ADMIN and gave it the path where the TNSNAMES.ORA file is located(in my case it is :C:\app\Mikola\product\11.2.0\client_1\Network\Admin\Sample).But this on it own was not enough. I had to add some parameters to the file by opening it in a simple Text editor like Notepad.Here I'm posting the inner look of the TNSNAMES.ORA file:

OracleServerHost =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.117.17.1)(PORT = 1521))
    (CONNECT_DATA =(SID = ORCL)
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

After saving and restaring VS 2010 I got "OracleServerHost" in the Data Source name drop down list.

P.S. Modifying the TNSNAMES.ORA file might not be necessary if you had already configured the file during the installation of Oracle Client.

Sign up to request clarification or add additional context in comments.

1 Comment

glad that it worked. I guess I should have told you that you needed a valid tnsnames.ora file as well! I have had your problem on most new installations with an existing tnsnames.ora file and I just jumped to that conclusion. glad it got you on the correct track and thanks for posting your solution
1

Your entries from TNSNames.ora should appear here and you would select the one that you need to use.

Since the drop down does not seem to be working, it would indicate that VS2010 cannot find your Oracle home.

An easy solution to this is to create an environmental variable called

TNS_ADMIN

and place the path to the TNSNames.ora file you wish to you as such

C:\app\MyDir\product\11.2.0\client_1\Network\Admin\

Close VS2010. Make the environment variable changes, then reopen, the drop down should then show you the available ora connections you may want to use.

(you can look @ this thread for a bit more info: http://forums.oracle.com/forums/thread.jspa?threadID=2213359&tstart=0)

hth

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.