Poderiam me ajudar a descobrir porque esta dando esse erro?
Código:
using (_connection = new MySqlConnection("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())
{
textBlock.Text = (reader.GetString("name"));
}
}
}