Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }