The NuGet package may not have passed testing yet for IoT.
There seems to be one way to do this.
- Go to https://dev.mysql.com/downloads/connector/net/ and downlaod the .NET & Mono version, no install.
- You may have to go through registration to get the download.
- Extract the contents and manually reference the RT DLL (Don't forget to set copy on build on the reference property pane, so the DLL gets copied to /bin on publish)
This DLL does not support SSL so your connection string needs sslmode=none
adding to it. Possibly your server needs to be able to accept non SSL too.
private const string mySQLConn = "Server={IP};Database=IoTApps;Uid=IoTApplication;Pwd={xxxx};SslMode=None;";
To get a DB connection you can use something like...
public MySqlConnection GetDB(string connectionString)
{
MySqlConnection db = new MySqlConnection(connectionString);
dbConn.Open();
return db;
}
You should be able to use Dapper on the IDBConnection
of MySqlConnetion too and execute normal SQL commands now to mapped objects.
Don't forget to close the db connection on dispose.
* Dapper
* Dapper single file source code if Nuget isnt playing ball again
* A nice tutorial on dapper