0
I am creating a WPF application, and decided to use the Entityframework to perform 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 tables and generating a context for them.
However, when you want to perform any kind of operation in the application, such as entering data into a table, for example, the program hangs and is automatically terminated (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();
}
}
The exceptions generated by:
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.
I edited the post with the complete exception.
– Lucas Dirani
i am using mysql in a project, to use I had to install in my project these packages, here and here
– Vinicius