How can I get MySqlCommand to play nicely with .NET Core?
Posted by: EDUARDO SILVA SILVA
Date: February 15, 2022 04:35PM

I've got a .NET Framework program that I'm trying to run on .NET Core. It uses MySql .NET 6.9.9.0. When I try and open a connection:

MySqlConnection conn = new MySqlConnection(connectionStringToDB);
conn.Open();
it crashes on the conn.Open() line with this exception:

WpfApp2 Error: 0 : 'Windows-1252' is not a supported encoding name.
For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. (Parameter 'name')
Exception thrown: 'System.ArgumentException' in MySql.Data.dll An unhandled exception of type 'System.ArgumentException' occurred in MySql.Data.dll
'Windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

I'm out of my depth -- can anyone shed light on this, and how to get around it?

Options: ReplyQuote


Subject
Written By
Posted
How can I get MySqlCommand to play nicely with .NET Core?
February 15, 2022 04:35PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.