.NET connecting to oracle problems with the connectionstring

Posted by Oxymoron on Stack Overflow See other posts from Stack Overflow or by Oxymoron
Published on 2010-04-22T10:28:57Z Indexed on 2010/04/22 10:33 UTC
Read the original article Hit count: 215

Filed under:
|
|
|
|

At the moment I'm trying to make a connection to a local server. Connecting via, say, TOAD works fine. When I try to connect using .NET I get ora-12154. Which puzzles me, since I'm using the connectionstring from my TNSNAMES.ora file:

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = myPC)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

As follows:

private string connectionString = "Data Source=(DESCRIPTION ="
    +"    (ADDRESS_LIST=(ADDRESS = (PROTOCOL = TCP)(HOST = myPC)(PORT = 1521)))"
    +"    (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = XE));"
    +"User Id=sys;Password=zsxyzabc;";

Any ideas?

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about .NET