Server Error in '/' Application.

Object cannot be cast from DBNull to other types.

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.InvalidCastException: Object cannot be cast from DBNull to other types.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidCastException: Object cannot be cast from DBNull to other types.]
   System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider) +55
   System.Convert.ToInt32(Object value, IFormatProvider provider) +33
   MySql.Data.MySqlClient.Driver.LoadCharacterSets(MySqlConnection connection) +303
   MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection) +171
   MySql.Data.MySqlClient.MySqlConnection.Open() +710
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +138
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +87
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1524
   System.Web.UI.WebControls.Repeater.GetData() +242
   System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +216
   System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +63
   System.Web.UI.WebControls.Repeater.DataBind() +81
   System.Web.UI.WebControls.Repeater.EnsureDataBound() +59
   System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e) +16
   System.Web.UI.Control.PreRenderRecursiveInternal() +90
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906


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