/// <summary>
        /// Advances the reader to the next record in a result set.
        /// </summary>
        /// <returns>
        /// true if there are more rows; otherwise false.
        /// </returns>
        public override bool Read()
        {
            if (this.wrappedReader.Read())
            {
                var values = new object[this.wrappedReader.FieldCount];

                this.wrappedReader.GetValues(values);
                SetValues(values);
                if (this.queryResults != null)
                {
                    this.queryResults.Rows.Add(values);
                    if (this.queryResults.Rows.Count > this.maxRows)
                    {
                        this.queryResults = null;
                    }
                }

                return true;
            }

            return false;
        }
 /// <summary>
 /// Initializes a new instance of the CachingDataReaderCacheReader class.
 /// </summary>
 /// <param name="queryResults">The query results.</param>
 public CachingDataReaderCacheReader(DbQueryResults queryResults)
 {
     this.queryResults = queryResults;
 }
        /// <summary>
        /// Advances the reader to the next result when reading the results of a batch of statements.
        /// </summary>
        /// <returns>
        /// true if there are more result sets; otherwise false.
        /// </returns>
        public override bool NextResult()
        {
            if (this.wrappedReader.NextResult())
            {
                this.queryResults = null;
                return true;
            }

            return false;
        }