I am getting this error when i hit the source.Open(); line of code and I cannot figure out why. I was using the unmanaged dll and I am trying to upgrade to the version Oracle.ManagedDataAccess.dll 64-bit and my project is using .NET framework 4. The TNS string is working in the production tnsnames.ora file(Ive replaced various element name and values). From the error it seems like something should be obviously wrong but I just cant get it to work.
TNS in app.config:
<oracle.manageddataaccess.client>
<version number="*">
<dataSources>
<dataSource alias="ABC_DEF_GH" descriptor="ABC_DEF_GH = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = server.company.com)(PORT = 11111))(CONNECT_DATA = (SERVICE_NAME = ABC_DEF_GH.company.com)))"/>
</dataSources>
</version>
</oracle.manageddataaccess.client>
Code snippet:
using (OracleConnection source = new OracleConnection("UserId=xxxxx;Password=xxxxxx;DataSource=ABC_DEF_GH;"))
{
OracleCommand command = new OracleCommand(transferConfig.QueryLogic + WhereClause, source);
//The time (in seconds) to wait for the command to execute. The default is 30 seconds.
command.CommandTimeout = transferConfig.SourceCommandTimeout;
// command.Connection.ConnectionTimeout is set in the connection string only
source.Open();
//...
}
Error: ORA-00303: Network Library: Name-Value syntax error
You should follow the following format for your connection string:
SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));uid=myUsername;pwd=myPassword;
Check with this format please, the error is related to using an incorrect format for the connection string.