I am trying to access an Oracle database (version 10.2.0.4.0) using the following code but an "ORA-01005: Null password given; logon denied" exception is raised by the connection when it's open method is called.
var connBuilder = new OracleConnectionStringBuilder();
connBuilder.DataSource = "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = MyHost.Address)(PORT = ####)) )(CONNECT_DATA =(SERVICE_NAME = MyService)))";
connBuilder.UserID = "validUserId";
connBuilder.Password = "validPassword";
connBuilder.PersistSecurityInfo = true;
var connString = connBuilder.ToString();
using (var con = new OracleConnection(connString))
{
con.Open();
}
If I change the username then I receive the following instead; "ORA-01017: invalid username/password; logon denied" and this is also the case if I change the open call on the connection with con.OpenWithNewPassword("validPassword");
If I try with the deprecated Oracle client it connects with no problems:
using (var depCon = new System.Data.OracleClient.OracleConnection
("Data Source=MyHost.Address:####/MyService;Persist Security Info=True;
User ID=validUsername;Password=validPassword;Unicode=True"))
{
depCon.Open();
}
I'd (obviously) like to use the latest Odp.Net drivers but can't seem to get past this issue. Has anybody got any ideas?