I was facing this issue. Hope someone could help me. The database has the following:
SELECT * FROM V$VERSION
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for IBM/AIX RISC System/6000: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
For another part, I have the latest Visual Studio Enterprise 2017 - Version 15.9.7
When I do this simple code:
Here is the code of the image:
using System;
using System.Data;
using System.Linq;
using Oracle.DataAccess.Client;
using Dapper;
namespace ConexDapper
{
class Program
{
static void Main(string[] args)
{
DateTime result = new DateTime();
using (var conex = CreateConnection())
{
result = conex.Query<DateTime>("Select sysdate from dual", null, commandType: CommandType.Text).FirstOrDefault();
}
Console.WriteLine(result);
}
public static IDbConnection CreateConnection()
{
var provider = new OracleClientFactory();
var conex = provider.CreateConnection();
conex.ConnectionString = "Data Source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 99.999.999.999)(PORT = 1525)) ) (CONNECT_DATA = (SERVICE_NAME = url.url.com) ));User Id=fail;password=fail;";
return conex;
}
}
}
Also, when I try this way.
However, When I try to connect with the new ODP. It fails.
Here is the code of the image:
using System;
using Oracle.ManagedDataAccess.Client;
namespace ConexDapper
{
class Program
{
static void Main(string[] args)
{
string conexString = "Data Source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 99.999.999.999)(PORT = 1525)) ) (CONNECT_DATA = (SERVICE_NAME = URL.url.url) ));User Id=fails;password=fails;";
var cn = new OracleConnection(conexString);
cn.Open(); // FAILSSSSS
Console.WriteLine("version --> " + cn.ServerVersion);
}
}
}
Also, If i try with the Visual Studio wizard is the same result.
To give extra information the versions of both DLL are:
According to dotPeek
Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342
For the other from nuget:
<package id="Oracle.ManagedDataAccess" version="18.3.0" targetFramework="net47" />