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); } }
/// <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; } }
/// <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); } }