System.Data.DataTableReader.ValidateState C# (CSharp) Method

ValidateState() private method

private ValidateState ( string caller ) : void
caller string
return void
        private void ValidateState(string caller)
        {
            ValidateOpen(caller);
            if (_tableCleared)
            {
                throw ExceptionBuilder.EmptyDataTableReader(_currentDataTable.TableName);
            }

            // see if without any event raising, if our curent row has some changes!if so reader is invalid.
            if ((_currentDataRow == null) || (_currentDataTable == null))
            {
                ReaderIsInvalid = true;
                throw ExceptionBuilder.InvalidDataTableReader(_currentDataTable.TableName);
            }

            //See if without any event raing, if our rows are deleted, or removed! Reader is not invalid, user should be able to read and reach goo row
            if ((_currentDataRow.RowState == DataRowState.Deleted) || (_currentDataRow.RowState == DataRowState.Detached) || _currentRowRemoved)
            {
                throw ExceptionBuilder.InvalidCurrentRowInDataTableReader();
            }
            // user may have called clear (which removes the rows without raing event) or deleted part of rows without raising event!if so reader is invalid.
            if (0 > _rowCounter || _currentDataTable.Rows.Count <= _rowCounter)
            {
                ReaderIsInvalid = true;
                throw ExceptionBuilder.InvalidDataTableReader(_currentDataTable.TableName);
            }
        }