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)) //|| (currentDataRow != currentDataTable.Rows[rowCounter])) do we need thios check! { 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 WebData98325 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); } else { } }
private void ValidateState(string caller) { this.ValidateOpen(caller); if (this.tableCleared) { throw ExceptionBuilder.EmptyDataTableReader(this.currentDataTable.TableName); } if ((this.currentDataRow == null) || (this.currentDataTable == null)) { this.ReaderIsInvalid = true; throw ExceptionBuilder.InvalidDataTableReader(this.currentDataTable.TableName); } if (((this.currentDataRow.RowState == DataRowState.Deleted) || (this.currentDataRow.RowState == DataRowState.Detached)) || this.currentRowRemoved) { throw ExceptionBuilder.InvalidCurrentRowInDataTableReader(); } if ((0 > this.rowCounter) || (this.currentDataTable.Rows.Count <= this.rowCounter)) { this.ReaderIsInvalid = true; throw ExceptionBuilder.InvalidDataTableReader(this.currentDataTable.TableName); } }