I think that no one is able to help you due to the fact that EF configuration should be done in several places.
I'd suggest to read official MySQL tutorials:
MySQL :: MySQL Connector/NET Developer Guide :: 6.6 Tutorial: Using an Entity Framework Entity as a Windows Forms DataSource[
^]
MySQL :: MySQL Connector/NET Developer Guide :: 7.1 Entity Framework 6 Support[
^]
According to your code...
If below line is responsible for connection string creation, you're in trouble!
string mrsales_Coonn = "SERVER=" + server + ";Port=" + port + ";DATABASE=" +
database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";" + OPTION + ";" + "charset=" + charset + ";Connect Timeout=1999999;";
First of all: you should
store connection string in config file, because it might change several times while developing process.
Second: do not use such of string concatenation. Rather than it, use:
string mrsales_Coonn = string.Format("SERVER={0};Port={1};DATABASE={2};UID={3};PASSWORD={4};{5};charset={6};Connect Timeout=1999999;", server, port, database, uid, password, option, charset);
or
string mrsales_Coonn = $"SERVER={server};Port={port};DATABASE={database};UID={uid};PASSWORD={password};{OPTION};charset={charset};Connect Timeout=1999999;";
As you can see, there's no name of option near
OPTION
variable! This might be the reason of error.
For proper connection string to MySQL database, please see:
MySQL connection strings - ConnectionStrings.com[
^]
Good luck!