Using System.Data.Common.DbProviderFactory with Mono
Hello,
I am trying to create an application which should be designed for common database connectivity. Therefore I used the System.Data.Common.DbProviderFactory. I created my application in Visual Studio and then tried to run it under Mono. I also tested it with Moma which gave me the go-ahead in any cases. In .Net everything worked fine but under Mono it threw a weired exception.
Unhandled Exception: System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider. () ()
at System.Data.Common.DbProviderFactories.GetFactory (System.Data.DataRow providerRow) [0x00000]
at System.Data.Common.DbProviderFactories.GetFactory (System.String providerInvariantName) [0x00000]
at Connectivity.DBLoader.Load () [0x00000]
I tried to google this one but without any success.
The code looks like this:
...
using System.Data.OracleClient;
using System.Data.Common;
...
DbProviderFactory factory = DbProviderFactories.GetFactory(providerString);
using (conn = factory.CreateConnection())
{
conn.ConnectionString = ConnectionParameter;
conn.Open();
// Here the data from the database is processed.
conn.Close();
}
Is there anything I did not consider or is it impossible to procede like this under Mono in general?
Thanks in advance for any help.
Best regard,
dr_d00m