Reputation: 1499
It's pretty confusing task to connect to oracle database. There are many steps to follow and I guess I followed almost everything and solved too many errors on the way. Now I'm stuck at this stage with the error
Oracle.DataAccess.Client.OracleException: ORA-12154: TNS:could not resolve the connect identifier specified
my tnsnames.ora file
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
my ORACLE_HOME path specified in environment variable
F:\app\Shuvro\product\12.1.0\dbhome_1\BIN;
my connectionstring in web.config
Data Source=ORCL;User Id=c##shuvro;Password=admin;Persist Security Info=True;
tnsping ORCL returned OK.
I'm using Visual Studio 2013 and Oracle 12c Enterprise Database. I installed ODP.NET and ODAC. Now what I'm missing here? Any help much appreciated.
Upvotes: 0
Views: 3811
Reputation: 684
You should download and install Oracle Developer Tools for Visual Studio to connect to oracle database
Upvotes: 0
Reputation:
modify tnsnames file to include name of your machine or IP address instead of localhost you can't rely for it to be translated correctly.
Upvotes: 1
Reputation: 329
Try this (server instead of data source)
Server=ORCL;User Id=c##shuvro;Password=admin;Persist Security Info=True;
Upvotes: 0