Exemplo n.º 1
0
 internal void Consume()
 {
     for (CommandResult nextResultSet = this.GetNextResultSet(null); nextResultSet != null; nextResultSet = this.GetNextResultSet(null))
     {
         nextResultSet.Consume();
     }
     if (this.storedProcedure != null)
     {
         this.storedProcedure.UpdateParameters(this.Parameters);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Closes the MySqlDataReader object.
        /// </summary>
        public void Close()
        {
            if (!isOpen)
            {
                return;
            }

            try
            {
                // finish any current command
                if (currentResult != null)
                {
                    currentResult.Consume();
                }

                connection.Reader = null;
                command.Consume();

                if (0 != (commandBehavior & CommandBehavior.CloseConnection))
                {
                    connection.Close();
                }
            }
            catch (MySqlException ex)
            {
                if (ex.IsFatal)
                {
                    connection.Reader = null;
                    connection.Terminate();
                }
                throw;
            }
            finally
            {
                isOpen = false;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Executes all remaining command buffers
        /// </summary>
        internal void Consume()
        {
            CommandResult result = GetNextResultSet(null);

            while (result != null)
            {
                result.Consume();
                result = GetNextResultSet(null);
            }

            // if we were executing a stored procedure and we are out of sql buffers to execute,
            // then we need to perform some additional work to get our inout and out parameters
            if (storedProcedure != null && sqlBuffers.Count == 0)
            {
                storedProcedure.UpdateParameters(Parameters);
            }
        }