For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
I am trying to connect to an Oracle XE instance using the ODP.NET managed driver. You can see here the using statement that references the client and the code at the point where the connection is instantiated and ready to be opened. You can see the connection string, but its components (Hostname, Port and Service) are empty. These are read-only properties, so I cannot set them. So, the connection string has to provide them. I have two connections strings that work when I create them in Visual Studio under Project Properties settings. DATA SOURCE=XE;PASSWORD=APX;USER ID=APX;PERSIST SECURITY INFO=True DATA SOURCE=LOCALHOST:1521/XE;PASSWORD=APX;USER ID=APX;PERSIST SECURITY INFO=True However, when I try to connect using a new connection object from the return value in the above function, as follows: OracleConnection myConnection = myConnectionTools.ToOracle(connectionString) myConnection.Open(); The first connection string (i.e. the TNS aliased connection) works, but I get this error for the second connection string. The connection string is valid. It works for Visual Studio. How do I tell the OracleConnection to use the Hostname, Port and Service rather than the TNS alias?