Soner Gönül
Soner Gönül

Reputation: 98868

cannot connect to Oracle database server; error regarding SQL Server

When I want to connect my Oracle database server in Visual Studio 2010, 1 hour ago there is no error but now I'm getting this error.

enter image description here

My web.config has a connection string:

<add name="ora" connectionString="Data Source=SCN;User id=********;Password=**********" providerName="System.Data.OracleClient" />

My TNSNAMES.ORA;

SCN=
  (DESCRIPTION=
    (ADDRESS=
      (PROTOCOL=TCP)
      (HOST=10.10.10.18)
      (PORT=1521)
    )
    (CONNECT_DATA=
      (SID=SCN)
    )
  )

I'm getting this strange error.

enter image description here

How can i solve this problem?

Upvotes: 0

Views: 405

Answers (2)

p.campbell
p.campbell

Reputation: 100657

Your Oracle connection string and .ora file aren't related to the connection error to SQL Server.

Your error is :

...establishing a connection to SQL Server....

Ensure your myConnection has the correct connection string as you'd expect. Something like this:

myConnection.ConnectionString = 
    ConfigurationManager.ConnectionStrings["ora"].ConnectionString;

Upvotes: 2

FerranB
FerranB

Reputation: 36837

You have to determine which connection string are you using and which connection data type. Try to output the content of:

myConnection.ConnectionString

and

myConnection.GetType().ToString()

also click on "Copy exception detail to the clipboard" to get more useful the real type of myConnection

Upvotes: 1

Related Questions