public DataRow ExecuteQueryRow(string CommandText) { DataRow row; try { DataTable table = this.ExecuteQueryTable(CommandText); row = (table.Rows.Count > 0) ? table.Rows[0] : null; } catch (Exception) { Output.WriteLine("(Sql) An exception has been throw while a query executon.\nDisposing MySql client #" + this.int_0 + " and retrying the QueryRowExecution.", OutputLevel.Notification); SqlDatabaseManager.dictionary_0.Remove(this.int_0); this.Close(); using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) { row = client.ExecuteQueryRow(CommandText); } } return(row); }
public DataTable ExecuteQueryTable(string CommandText) { DataTable table; try { DataSet set = this.ExecuteQuerySet(CommandText); table = (set.Tables.Count > 0) ? set.Tables[0] : null; } catch (Exception exception) { Console.WriteLine("Exception: " + exception); Output.WriteLine("(Sql) An exception has been throw while a query executon.\nDisposing MySql client #" + this.int_0 + " and retrying the QueryTableExecution.", OutputLevel.Notification); SqlDatabaseManager.dictionary_0.Remove(this.int_0); this.Close(); using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) { table = client.ExecuteQueryTable(CommandText); } } return(table); }
public object ExecuteScalar(string CommandText) { object obj3; try { this.mySqlCommand_0.CommandText = CommandText; object obj2 = this.mySqlCommand_0.ExecuteScalar(); this.ResetCommand(); obj3 = obj2; } catch (Exception) { Output.WriteLine("(Sql) An exception has been throw while a query executon.\nDisposing MySql client #" + this.int_0 + " and retrying the QueryScalarExecution.", OutputLevel.Notification); SqlDatabaseManager.dictionary_0.Remove(this.int_0); this.Close(); using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) { obj3 = client.ExecuteScalar(CommandText); } } return(obj3); }
public int ExecuteNonQuery(string CommandText) { int num2; try { this.mySqlCommand_0.CommandText = CommandText; int num = this.mySqlCommand_0.ExecuteNonQuery(); this.ResetCommand(); num2 = num; } catch (Exception exception) { Console.WriteLine("Exception: " + exception); Output.WriteLine("(Sql) An exception has been throw while a query executon.\nDisposing MySql client #" + this.int_0 + " and retrying the NonQueryExecution.", OutputLevel.Notification); SqlDatabaseManager.dictionary_0.Remove(this.int_0); this.Close(); using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) { num2 = client.ExecuteNonQuery(CommandText); } } return(num2); }