Pouya
Pouya

Reputation: 1918

How to use Entity Framework with an Oracle database

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

Upvotes: 0

Views: 1468

Answers (1)

Ezio Auditore da Firenze
Ezio Auditore da Firenze

Reputation: 1226

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.

Upvotes: 1

Related Questions