Hi, I'm using mysql.data in uwp, vs 2017. I download the 6.10.5 in nuget.
But Now I can't connect to server. I searched the docs, the following two links are different, and neither works.
https://dev.mysql.com/doc/connector-net/en/connector-net-programming-connecting-connection-string.html
https://dev.mysql.com/doc/dev/connector-net/8.0/html/connector-net-x-devapi-getting-started.htm
my code is
public static MySqlConnection CreateMySqlConnection()
{
string strConn = String.Format("server={0}; uid={1}; pwd={2}; database={3}; port={4};",
strServer, strUserID, strPassword, strDatabase, strPort);
MySqlConnection conn = null;
try
{
conn = new MySqlConnection(strConn);
conn.Open();
}
catch (Exception ex)
{
}
return conn;
}
It throws an exception:
Could not load file or assembly 'System.Net.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.