MySql Connection is going to sleep mode instead of close in mysql. I am using MySql.Data 6.5.4 version to communicate with mysql. I am not sure what am I doing wrong in below code.
try
{
using (var conn = new MySqlConnection(strConnection))
{
conn.Open();
using (var cmd = new MySqlCommand(strSQLStatement, conn))
{
var adapter = new MySqlDataAdapter(cmd);
adapter.Fill(ds);
}
}
}
catch (Exception ex)
{
ErrorLogger.WriteError(string.Format("Failed query {0} with stack trace {1} ", strSQLStatement, ex), "GetData");
}