Value cannot be null. Parameter name: hostNameOrAddress
Posted: Fri 23 Oct 2020 15:22
Can't solve this issue with a simple DB connection. Exception and Code below.
It is not the same issue as in the "Possible regression: Value cannot be null. (Parameter 'hostname')" topic. My problem occurs with older versions like 9.11.980 and with 9.13.1107 and also with SID instead of ServiceName.
Any Ideas?
It is not the same issue as in the "Possible regression: Value cannot be null. (Parameter 'hostname')" topic. My problem occurs with older versions like 9.11.980 and with 9.13.1107 and also with SID instead of ServiceName.
Any Ideas?
Code: Select all
Exception thrown: 'System.ArgumentNullException' in Devart.Data.Oracle.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>ServerManagement.exe</AppDomain><Exception><ExceptionType>System.ArgumentNullException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Value cannot be null.
Parameter name: hostNameOrAddress</Message><StackTrace> at Devart.Data.Oracle.bw.a(List`1 A_0, SshOptions A_1, SslOptions A_2, Boolean A_3)
at Devart.Data.Oracle.cr.a(d4 A_0, Boolean A_1)
at Devart.Data.Oracle.cr.a(d4 A_0, b0 A_1)
at Devart.Data.Oracle.OracleInternalConnection..ctor(d4 connectionOptions, OracleInternalConnection proxyConnection)
at Devart.Data.Oracle.ef.a(aa A_0, Object A_1, DbConnectionBase A_2)
at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, aa A_1, DbConnectionBase A_2)
at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
at Devart.Common.DbConnectionBase.Open()
at Devart.Data.Oracle.OracleConnection.Open()
at ServerManagement.SnpData.BuildSnpTexData() in C:\Users\tusk\Documents\dev\AVATARS\ServerManagement\SnpData.cs:line 25
at ServerManagement.Program.Main(String[] args) in C:\Users\tusk\Documents\dev\AVATARS\ServerManagement\Program.cs:line 23</StackTrace><ExceptionString>System.ArgumentNullException: Value cannot be null.
Code: Select all
OracleConnectionStringBuilder oraCSB = new OracleConnectionStringBuilder();
oraCSB.Direct = true;
oraCSB.Server = "<hostname>";
oraCSB.Port = 1521;
oraCSB.ServiceName = "<service name>";
oraCSB.UserId = "<user>";
oraCSB.Password = "<password>";
oraCSB.Pooling = true;
OracleConnection myConnection = new OracleConnection(oraCSB.ConnectionString);
myConnection.Open();