Currently, I am using both of .NET 2.0 and .NET 4.0 Framework websites. All Websites are using MySql.Data.dll 6.8.3 ver.
I found the reason for 'KeyNotFoundException' from these references that indicate unsupported chatset is the problem.
- References #1. https://jira.mariadb.org/browse/MDEV-26105?attachmentViewMode=list #2. System.NotSupportedException: Character set 'utf8mb3' is not supported by .Net Framework*
So I changed the mysql connector version.
.NET 4.0 websites are working by
- changing MySql.Data.dll from 6.8.3 to 8.0.33
- install .NET 4.6.2 Frameworks
- edit machine.config file.
But the problem is .NET 2.0 websites because MySql.Data.dll 8.0.33. ver supports .NET Framework 4.6.2 above
I am trying to solve instead of changing website to .NET 4.0.
I changed Table Charset utf8mb3 to utf8mb4.
ALTER [TABLE] CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
Using SQL scripts are solved but I got same problem('KeyNotFoundException') by using procedures.
Database database = new GernericDatabase(base.GetConnectionMainDB(), GetMySQLDbProvider());
// **Worked Well**
query = "select * from [table]";
DbCommand cmd = database.GetSqlStringCommand(query);
cmd.ExecuteReader();
// **Worked Wrong **
DbConnection con = data.CreateConnection();
DbCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = [procedureName];
cmd.ExecuteReader(); // KeyNotFoundException
I didn't the reason why error from using procedures.
If I use SQL script SHOW CREATE PROCEDURE [procedure name].
SQL script results character_set_client : utf8mb4 collation_connection : utf8mb4_gerneral_ci Database Collation : utf8mb4_gerneral_ci
Is there any way that I can use .net 2.0 framework with mysql db ver 10.6?
Summary #1 Trying to solve .NET 4.0 Framework
- changed MySql.Data.dll version to 8.0.33 - it works
#2 Trying to solve .NET 2.0 Framework
- changed Table charset - SQL commands worked but procedure didn't work
- changed MySql.Data.dll version to 8.0.33 - does not support on .NET 2.0 Framework