Reputation: 11393
I have an old application and after a long time when i try to test it .I get the following exception :
Unable to find the requested .Net Framework Data Provider. It may not be installed.
My code :
public DBConnection(string ConnectionString)
{
this.providerFactory = DbProviderFactories.GetFactory("IBM.Data.Informix");//Exception here
this.connection = new IfxConnection();
if (string.IsNullOrEmpty(ConnectionString))
{
this.connection.ConnectionString = ConfigurationManager.ConnectionStrings["r_informix"].ToString();
}
else
{
this.connection.ConnectionString = ConfigurationManager.ConnectionStrings["r_informix"].ToString();
}
command = this.connection.CreateCommand();
}
I try to do the following solution here
</runtime>
<system.data>
<DbProviderFactories>
<add name="IBM.Data.Informix"
invariant="IBM.Data.Informix.Client"
description="Informix Data Provider for .NET"
type="IBM.Data.Informix,
IBM.Data.Informix,
Version=3.0.0.2,
Culture=Neutral,
PublicKeyToken=7c307b91aa13d208" />
</DbProviderFactories>
</system.data>
but In vain ...
Upvotes: 2
Views: 1804
Reputation: 328
I've found this: How to register .NET provider. I hope it helps.
Also you could try to install manually IBM.Data.Informix and IBM.Data.DB2 in GAC.
Upvotes: 1
Reputation: 4954
According to the MSDN documentation for the GetFactory function the parameter provided should match with the invariant name of the provider factory, which is set as IBM.Data.Informix.Client in your config file but you are passing IBM.Data.Informix (without .Client).
Upvotes: 2