Server Error in '/' Application.

The given key was not present in the dictionary.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

Source Error:


Line 27:                 CMD.CommandType = CommandType.Text;
Line 28:                 CMD.Parameters.AddWithValue("@Cd_Produto", FotoId6);
Line 29:                 connection.Open();
Line 30:                 object result = CMD.ExecuteScalar();
Line 31: 

Source File: \\10.190.6.17\imsj.ind.br\public\App_Code\ClsPhoto6.cs    Line: 29

Stack Trace:


[KeyNotFoundException: The given key was not present in the dictionary.]
   System.Collections.Generic.Dictionary`2.get_Item(TKey key) +13029779
   MySql.Data.MySqlClient.CharSetMap.GetCharacterSet(DBVersion version, String CharSetName) +23
   MySql.Data.MySqlClient.CharSetMap.GetEncoding(DBVersion version, String CharSetName) +40
   MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection) +729
   MySql.Data.MySqlClient.MySqlConnection.Open() +466
   ClsPhoto6.Photo6(Int32 FotoId6) in \\10.190.6.17\imsj.ind.br\public\App_Code\ClsPhoto6.cs:29
   Image6.ProcessRequest(HttpContext context) in \\10.190.6.17\imsj.ind.br\public\Image6.ashx:22
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +195
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0