0

I'm a starter in Oracle, I want to use Entity Framework to connect to my Oracle database.

I first installed Oracle 11g R2 and get this and then I install NetManager and create new Service Name

enter image description here

Then, I go to Visual Studio and create a new model but wWhen I want to create a connection it gives me an error message.

enter image description here

Please help me. thanks all

1 Answer 1

1

It had happened me once. In your Oracle home directory there must be two folder in directory C or D:\app\user\product\11.2.0:

Names of folder must be smth like that:

client_1   and    dbhome_1

There must be tnsnames.ora in \client_1\Network\Admin\Sample. If not, create one. Then first of all delete all texts in this file and copy this to that file:

orcl=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.77.31)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))

Instead orcl you will write your data Source. Also for host and port number. And Service name.

It must work. If not copy tnsnames.ora and listener.ora to \client_1\Network\Admin.

And test it again.

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

10 Comments

@ FerhadJabiyev: in Sample folder have two files , sqlnet.ora and tnsnames.ora,Then I can put into one file? thanks
tnsnames.ora file and You must copy Listener.ora file from dbhome_1\Network\Admin\Sample to client_1\Network\Admin\Sample
# tnsnames.ora Network Configuration File: J:\app\MOHSEN\product\11.2.0\client_1\NETWORK\ADMIN\tnsnames.ora # Generated by Oracle configuration tools. CMMorcl=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.135.23)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))
@mohsen everything seems ok here. Have you copied Listener.ora from dbhome_1\Network\Admin\Sample to client_1\Network\Admin\Sample?
@mohsen ok. And have you copied all files from client_1\Network\Admin\Sample to client_1\Network\Admin?
|

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.