开发者

cannot connect to Oracle database server; error regarding SQL Server

开发者 https://www.devze.com 2023-02-19 03:32 出处:网络
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.

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.

cannot connect to Oracle database server; error regarding SQL Server

My web.config has a connection string:

<add name="ora" connectionString="D开发者_运维问答ata 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.

cannot connect to Oracle database server; error regarding SQL Server

How can i solve this problem?


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;


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

0

精彩评论

暂无评论...
验证码 换一张
取 消