public IWhizzDataReader ExecuteReader()
        {
            CheckDisposedState();

            if (this.DataReader != null)
            {
                throw new Exception("Datareader must be null after disposing");
            }

            SqlDataReader reader;

            try
            {
                // Execute the reader...
                reader = this.Command.ExecuteReader();
            }
            catch (SqlException ex)
            {
                throw new Exception(ex.Message);
            }

            this.DataReader = new SQLServerDataReader(reader, this.connection.Database);

            // Return...
            return this.DataReader;
        }
        /// <summary>
        /// Private Dispose method
        /// </summary>
        private void Dispose(bool disposing)
        {
            if (!this.isDisposed)
            {
                if (disposing == true)
                {
                    if (this.DataReader != null)
                    {
                        this.DataReader.Dispose();
                        this.dataReader = null;
                    }
                    if (this.Command != null)
                    {
                        this.Command.Dispose();
                        this.command = null;
                    }

                    if (this.Connection != null)
                    {
                        this.Connection.Dispose();
                        this.connection = null;
                    }

                    if (this.dataAdapter != null)
                    {
                        this.dataAdapter.Dispose();
                        this.dataReader = null;
                    }
                    SQLServerDBProvider.numberOfCurrentlyOpenConnections--;
                }
                this.isDisposed = true;
            }
        }
 /// <summary>
 /// Checks if the data reader object of this SQLServerDBProvider is disposed and, if not, closes it and disposes it.
 /// This is needed for code that plans to execute a reader more than once on the same provider object, as
 /// this SQLServerDBProvider only allows one instance of a reader to exist at a time.
 /// </summary>
 public void CloseDataReader()
 {
     if (this.DataReader != null)
     {
         this.DataReader.Dispose();
         this.DataReader = null;
     }
 }
        public IWhizzDataReader ExecuteReader(int timeOut)
        {
            CheckDisposedState();

            if (this.DataReader != null)
            {
                throw new Exception("Datareader must be null after disposing");
            }

            this.Command.CommandTimeout = timeOut;

            SqlDataReader reader;

            try
            {
                reader = this.Command.ExecuteReader();
            }
            catch (SqlException ex)
            {
                throw new Exception(ex.Message);
            }

            this.DataReader = new SQLServerDataReader(reader, this.connection.Database);

            return this.DataReader;
        }