Connect with Mysql universal win 10 [closed]

-2

I would like a help, as I would like to know how do I get information from a Mysql database and which will be assumed by a textblock. would they be able to help me with the code that does this?

EX: In the database name = John the textblock will be John.

    
asked by anonymous 09.03.2017 / 00:44

1 answer

-1
  

Although this connection method has been discontinued I'll post a response if it's helpful

Download and install the following files (win64):
link
link

To avoid errors with Encoding Exception select:

CreateaUWPprojectandaddareferencetoC:\ProgramFiles(x86)\MySQL\MySQLConnectorNet6.7.X\Assemblies\RT\MySql.Data.RT.dll

Toconnectandqueryyourtabledata:

using(_connection=newMySqlConnection("Database=test;Data Source=localhost;User Id=root;Password=teste;SslMode=None;"))
{
    _connection.Open();
    var cmd = new MySqlCommand("select name from user where id=1", _connection);
    using (var reader = cmd.ExecuteReader())
    {
        if (reader.Read())
        {
            TextBlockName.Text = (reader.GetString("name"));
        }
    }
}


Source: link

References:
link link link

    
09.03.2017 / 03:13