Vikas Shah
Vikas Shah

Reputation: 21

Why do I get error "ORA-12154: TNS:could not resolve the connect identifier specified"?

ORA-12154: TNS:could not resolve the connect identifier specified" When try to connect visual studio 12 to oracle 10g[ new2 new

Upvotes: 1

Views: 4207

Answers (1)

Sanjay Radadiya
Sanjay Radadiya

Reputation: 1286

try this connection string with some server and database params

Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=urHost)(PORT=urPort)))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=urOracleSID)));User Id=urUsername;
Password=urPassword;

chanage urHost,urPort,urOracleSID,urUsername,urPassword as per your database configuration.

if you are using web.config connection then you may use

<connectionStrings>
   <add name="{ConnectionName}" 
      connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;" 
        providerName="Oracle.DataAccess.Client"/>
</connectionStrings>

or if you using visual studio 2012 then follow below screenshot

enter image description here

enter image description here

Upvotes: 1

Related Questions