I have two vb
.net 2.0 winforms applications, A and B. A currently talks to a remote Oracle database just fine, B needs to talk to a different database, but from the same host.
Should be easy! Update tnsnames.ora for the new db, copy some code from A to B, change the connection and query, off we go.
The problem is, I can't get B to connect to anything
. It always gives the old ora-12154 error that it can't resolve the connect identifier when I try the Open() method on the OracleConnection object.
else on my dev machine is able to talk to B's database: tnsping, sql plus client, even copy-and-pasting the connection string into app A and watching it successfully perform the open via VS debugging.
I've also tried copying A's connection (which I know works) to B. B fails to resolve the identifer with the same exception.
So, from my testing, I believe I've validated:
- the tnsnames.ora file (A, tnsping, and sql plus* can connect)
- the connection string (given the same string, A can connect)
I just can't track down whatever was done in A to make it properly talk to the remote databases (or what was done in B to disallow that).
I've also checked the path environment variable to ensure I have a path to the oracle client, and given everyone full access to all tnsnames files on my box, just in case it was a weird permission issue. Also tried re-booting, thinking maybe B had cached the tnsnames file. Nothing.
Here's how I'm trying to connect:
Dim conn As OracleConnection = Nothing
conn = New OracleConnection("Data Source=xxx.WORLD;User Id=xxx;Password=xxx;")
As I said, I've validated the connection string by copying it into A and seeing that connect properly. Now I'm just looking for ideas what might be B's problem.