0

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.

So I changed the mysql connector version.

.NET 4.0 websites are working by

  1. changing MySql.Data.dll from 6.8.3 to 8.0.33
  2. install .NET 4.6.2 Frameworks
  3. 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

  1. changed MySql.Data.dll version to 8.0.33 - it works

#2 Trying to solve .NET 2.0 Framework

  1. changed Table charset - SQL commands worked but procedure didn't work
  2. changed MySql.Data.dll version to 8.0.33 - does not support on .NET 2.0 Framework
CY96
  • 1
  • 1

0 Answers0