public DataSet ExecuteDataset(string connectionString, CommandType commandType, string commandText) { DataSet ds = new DataSet(); using (MySqlConnection cn = new MySqlConnection(connectionString)) { MySqlCommand cmd = new MySqlCommand(commandText, cn); MySqlDataAdapter da = new MySqlDataAdapter(cmd); try { da.Fill(ds); } catch (Exception ex) { errorDescription = ex.Message.ToString().Replace("\n", ""); string s = errorDescription.Substring(0, 6); if (errorDescription.Substring(0, 6) == "#42000") { MySqlCommand cmd1 = new MySqlCommand("SET SQL_BIG_SELECTS = 1", cn); try { cn.Open(); cmd1.ExecuteNonQuery(); da.Fill(ds); } catch (Exception) { errorDescription = ex.Message.ToString().Replace("\n", ""); SendToErrorPage(errorDescription); } finally { cmd1.Parameters.Clear(); cmd1.Dispose(); cn.Close(); } } else { SendToErrorPage(errorDescription); } } finally { cmd.Parameters.Clear(); cmd.Dispose(); cn.Dispose(); } } replaceCorrectValues(ds); return ds; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)