I'm creating a WPF application, and I decided to use EntityFramework to perform the operations in my bank. I created a data model from an existing database in my MySQL Workbench, and the process was executed correctly, exporting all the tables and generating a context for them.
However, when I want to perform any type of operation in the application, such as inserting data into a table, for example, the program locks and closes automatically (without giving any error message). And the data is also not being stored in the database.
The code that is giving error is as follows:
private void Button_Click(object sender, RoutedEventArgs e)
{
using (maisfilmesEntities ctx = new maisfilmesEntities())
{
usuario u = new usuario
{
login = "Teste",
senha = "teste"
};
ctx.usuario.Add(u);
ctx.SaveChanges();
}
}
Exceptions generated:
MySql.Data.MySqlClient.MySqlException (0x80004005): The host localhost does not support SSL connections.
em MySql.Data.MySqlClient.NativeDriver.Open()
em MySql.Data.MySqlClient.Driver.Open()
em MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
em MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
em MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
em MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
em MySql.Data.MySqlClient.MySqlPool.GetConnection()
em MySql.Data.MySqlClient.MySqlConnection.Open()
em System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher <Open>b__36(DbConnection t, DbConnectionInterceptionContext c)
Error caught with try / catch:
The underlying provider failed on Open.