Connection string to mysql 6.10.5
Posted by: Wang Vincent
Date: January 14, 2018 11:54AM

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'.

Options: ReplyQuote


Subject
Written By
Posted
Connection string to mysql 6.10.5
January 14, 2018 11:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.