Reputation: 98868
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.
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.
How can i solve this problem?
Upvotes: 0
Views: 405
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
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