[Mono-list] Solved:- Oracle Client Connection: Connection parameter not supported
Gary Hodgson
gary.s.hodgson at gmail.com
Tue Oct 21 08:17:06 EDT 2008
I post the following on the off-chance it saves some time for anyone who may
be having the same problem.
I was connecting to an Oracle (10g) database using the instructions here:
http://mono-project.com/Oracle, and everything was going swimmingly until I
had to use a connection string as per the instructions at "Connection String
Format using TNS network description which does not use a tnsnames.ora
file". I.e. using a connection string that looked like this:
string connectionString = "User ID=user;Password=password;Data
Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1521))(CONNECT_DATA
= (SID = database)(SRVR=DEDICATED)))";
Under MS.NET this would work ok, but under Mono it would throw the
following:
Unhandled Exception: System.ArgumentException: Connection parameter not
supported: 'database)(SRVR'
at System.Data.OracleClient.OracleConnection.SetProperties
(System.Collections.Specialized.NameValueCollection parameters) [0x00000]
at System.Data.OracleClient.OracleConnection.SetConnectionString
(System.String connectionString, Boolean persistSecurity) [0x00000]
at System.Data.OracleClient.OracleConnection..ctor (System.String
connectionString) [0x00000]
at (wrapper remoting-invoke-with-check)
System.Data.OracleClient.OracleConnection:.ctor (string)
With hindsight it's annoyingly obvious that by wrapping the data source in
quotes solves the problem, i.e.
string connectionString = "User ID=user;Password=password;Data Source= \'
(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1521))(CONNECT_DATA =
(SID = database)(SRVR=DEDICATED))) \' ";
--
View this message in context: http://www.nabble.com/Solved%3A--Oracle-Client-Connection%3A-Connection-parameter-not-supported-tp20087966p20087966.html
Sent from the Mono - General mailing list archive at Nabble.com.
More information about the Mono-list
mailing list