I used x64 bit odp.net (Oracle.DataAccess.dll version 220.127.116.11) on windows 8 Turkish (Microsoft Windows [Version 6.2.9200]).
I encountered some problem and I would like to know if it's a known issue.
The following code will throw an exception :
DbProviderFactory dbFactory = DbProviderFactories.GetFactory("Oracle.DataAccess.Client");
DbConnection conn = dbFactory.CreateConnection();
DbConnectionStringBuilder connStringBuilder = dbFactory.CreateConnectionStringBuilder();
connStringBuilder.ConnectionString = "USER ID=myname;DATA SOURCE=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=servicename)));PASSWORD=Password" conn.ConnectionString = connStringBuilder.ConnectionString;
The exception is
-İş şu hatayı vererek başarısız oldu: -ORA-12533: TNS:illegal ADDRESS parameters
--ORA-12533: TNS:illegal ADDRESS parameters
However, if I just assign the connection string to the DbConnection object without modify it using the connection string builder, the connection will be opened.
Is this a known issue?
public OracleConnection baglanti;
string yol = " Data Source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = " + seninipadresin + ")(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = " + oracleservicename + ") ) );User Id=" + oracle_userin+ ";Password=" + oraclesifren+ ";";
baglanti = new OracleConnection(yol);
Bu sekilde ben programlarda kullaniyorum .
I recall a particularly nasty bug we encountered a couple of years ago using ODP.NET 10.2 where case-change was not handled correctly in ODP.NET or Oracle InstantClient. If memory services me right, the conclusion was Oracle uses ToUpper() or ToLower() for case-insensitive comparison of the connection string and in doing so removes information. If I recall correctly it was the letter i used in 'User id' that folded into another character altogether causing the statement to be invalid no matter the case of usernames/passwords. I think we used string.ToUpper() before sending the string to Oracle and then it did not convert and we where fine.
My recommendation is to try sending connection string in all-upper or all-lower and see if that works. Usernames and Passwords have to be handled separately then of course.