Quantcast
Channel: dbschemareader Discussions Rss Feed
Viewing all articles
Browse latest Browse all 166

New Post: Mono/Xamarin (on Mac) + MySQL/PostgreSQL issues...

$
0
0
I can use the MySqlConnection class directly just fine:
String params = String.Format("Server={0};Port={1};Database={2};User ID={3};Password={4};", host, port, database, username, password);
mysql = new MySqlConnection(params);
... but loading the same connector/driver using the provider string mechanism to create a DatabaseReader object fails with:
"A System.Configuration.ConfigurationErrorsException was thrown. Failed to find or load the registered .Net Framework Data Provider 'MySql.Data.MySqlClient'."
When I call DbProviderFactories.GetFactoryClasses() to see what's available, MySQL and PostgreSQL are not listed (but, again, both are present and can be used directly just fine in the same project).

Oracle, SQL Server, Sybase, ODBC, and SQLite all show up, but not MySQL/PostgreSQL. It's worth noting that these 2 are the only ones whose references must be added from files. The others are available from the standard list in Xamarin Studio.

It don't think it's a permissions issue since I can use both of those drivers/connectors directly:
switch (type)
{
    case XYZSQLDatabaseType.MySQL:
    {
         String params = String.Format("Server={0};Port={1};Database={2};User ID={3};Password={4};", host, port, database, username, password);
         mysql = new MySqlConnection(params);
         break;
    }
    case XYZSQLDatabaseType.PostgreSQL:
    {
         String params = String.Format("Server={0};Port={1};Database={2};User ID={3};Password={4};", host, port, database, username, password);
         postgresql = new NpgsqlConnection(params);
        break;
    }
    ...
I've tried resetting the provider factories cache and I've tried adding (in addition to mysql.data.dll) mysql.data.entity.dll and mysql.web.dll.

Anything else I can try?

Viewing all articles
Browse latest Browse all 166

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>