I've created a basic console app for playing around with Simple.Data against an Oracle server. However, when trying to open a connection I get the following error: "No ADO Provider found."
I installed the following NuGet packages:
This is my code:
class Program
{
static void Main(string[] args)
{
string connectionString = ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;
var db = Database.OpenConnection(connectionString); // this is where I get the error
var list = db.MyTable.All().ToList();
}
}
app.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="MyConnectionString" connectionString="user id=SomeUser;password=SomePwd;data source=MyTNS" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.112.3.0" newVersion="4.112.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
And MyTNS does exist.
What am I missing?
You missed the providerName
attribute.
<connectionStrings>
<add name="MyConnectionString"
connectionString="user id=SomeUser;password=SomePwd;data source=MyTNS"
providerName="Oracle.DataAccess.Client"
/>
</connectionStrings>