SeeuD1 SeeuD1 - 4 months ago 39
C# Question

Which assembly for MySQL Connection for Universal App

I want to build a connection to a database using the MySQL Connector. I get a connection with the assembly

MySql.Data.RT.dll
but this was for Win RT. Is this also the right one for a Win 10 Universal app, or is it better to use one of the .NET 4.5 Framework:

enter image description here

My Question is:

Which assembly to choose for a Windows Universal App ?

Answer

MySql connections are happen through

MySql.Data and MySql.Data.MySqlClient

these two assemblies are most commonly used dll files for any mysql connectivity.

For Example code in C#:

    MySqlConnection MYSQLCON;
    MySqlDataAdapter daDataAdapter;
    MySqlCommand MYSQLCmd;
    public MYSQLDataAccess()
    {
        ConnectionStrinG = getMySqlConnectionString();
        MYSQLCON = new MySqlConnection(ConnectionStrinG);
    }
    public string getMySqlConnectionString()
    {
        string CString = ConfigurationManager.AppSettings["MyCString"].ToString();  // Connection string from web.config
        string ConStr = ConfigurationManager.ConnectionStrings[CString].ToString();
        return ConStr;
    }
Comments