125 references to _sharedState
System.Data (125)
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (124)
118
_sharedState
._dataReady = false;
207
if (-1 ==
_sharedState
._columnDataBytesRemaining) {
208
_sharedState
._columnDataBytesRemaining = (long)_parser.PlpBytesLeft(_stateObj);
211
return
_sharedState
._columnDataBytesRemaining;
718
if (0 ==
_sharedState
._nextColumnHeaderToRead) {
732
if (!_stateObj.Parser.TrySkipRow(_metaData,
_sharedState
._nextColumnHeaderToRead, _stateObj)) {
747
_sharedState
._dataReady = false;
768
Debug.Assert(!
_sharedState
._dataReady, "_dataReady should be cleared");
908
_sharedState
._dataReady = true; // set _sharedState._dataReady to not confuse CleanPartialRead
911
if (
_sharedState
._dataReady) {
1566
if (
_sharedState
._nextColumnHeaderToRead <= i) {
1578
if ((-1 ==
_sharedState
._columnDataBytesRemaining) && (_metaData[i].metaType.IsPlp)) {
1583
_sharedState
._columnDataBytesRemaining = (long)left;
1586
if (0 ==
_sharedState
._columnDataBytesRemaining) {
1596
remaining =
_sharedState
._columnDataBytesRemaining;
1611
if ((cb >
_sharedState
._columnDataBytesRemaining) && !_metaData[i].metaType.IsPlp) {
1640
_sharedState
._columnDataBytesRemaining -= cb;
1789
Debug.Assert(
_sharedState
._nextColumnHeaderToRead == i + 1 &&
_sharedState
._nextColumnDataToRead == i, "Non sequential access");
1807
if ((
_sharedState
._columnDataBytesRemaining == 0) || (length == 0)) {
1825
_sharedState
._columnDataBytesRemaining = -1;
1828
_sharedState
._columnDataBytesRemaining = (long)left;
1833
int bytesToRead = (int)Math.Min((long)length,
_sharedState
._columnDataBytesRemaining);
1836
_sharedState
._columnDataBytesRemaining -= bytesRead;
2012
if ((
_sharedState
._nextColumnDataToRead == (i+1)) && (
_sharedState
._nextColumnHeaderToRead == (i+1)) && (_columnDataChars != null) && (IsCommandBehavior(CommandBehavior.SequentialAccess)) && (dataIndex < _columnDataCharsRead)) {
2108
if (
_sharedState
._nextColumnHeaderToRead <= i) {
2131
if (-1 ==
_sharedState
._columnDataBytesRemaining) {
2132
_sharedState
._columnDataBytesRemaining = (long)_parser.PlpBytesLeft(_stateObj);
2135
if (0 ==
_sharedState
._columnDataBytesRemaining) {
2172
_sharedState
._columnDataBytesRemaining = (long)_parser.PlpBytesLeft(_stateObj);
2824
if (
_sharedState
._dataReady) {
2918
if ((IsCommandBehavior(CommandBehavior.SequentialAccess)) && ((
_sharedState
._nextColumnHeaderToRead > i + 1) || (_lastColumnWithDataChunkRead > i))) {
3154
if (
_sharedState
._dataReady) {
3164
_sharedState
._nextColumnHeaderToRead = 0;
3165
_sharedState
._nextColumnDataToRead = 0;
3166
_sharedState
._columnDataBytesRemaining = -1; // unknown
3180
if (!_parser.TryRun(RunBehavior.ReturnImmediately, _command, this, null, _stateObj, out
_sharedState
._dataReady)) {
3184
if (
_sharedState
._dataReady) {
3192
_sharedState
._dataReady = true;
3196
if (
_sharedState
._dataReady) {
3222
while (_stateObj._pendingData && !
_sharedState
._dataReady) {
3223
if (!_parser.TryRun(RunBehavior.ReturnImmediately, _command, this, null, _stateObj, out
_sharedState
._dataReady)) {
3229
if (
_sharedState
._dataReady) {
3239
_sharedState
._nextColumnHeaderToRead = 0;
3329
Debug.Assert(
_sharedState
._nextColumnHeaderToRead <= _metaData.Length, "_sharedState._nextColumnHeaderToRead too large");
3330
Debug.Assert(
_sharedState
._nextColumnDataToRead <= _metaData.Length, "_sharedState._nextColumnDataToRead too large");
3376
if (!_data[
_sharedState
._nextColumnDataToRead].IsNull) {
3377
_SqlMetaData columnMetaData = _metaData[
_sharedState
._nextColumnDataToRead];
3379
if (!_parser.TryReadSqlValue(_data[
_sharedState
._nextColumnDataToRead], columnMetaData, (int)
_sharedState
._columnDataBytesRemaining, _stateObj,
3384
_sharedState
._columnDataBytesRemaining = 0;
3386
_sharedState
._nextColumnDataToRead++;
3397
if (!
_sharedState
._dataReady) {
3444
if (i <
_sharedState
._nextColumnHeaderToRead) {
3446
if ((i ==
_sharedState
._nextColumnDataToRead) && (!readHeaderOnly)) {
3452
Debug.Assert(i ==
_sharedState
._nextColumnDataToRead || // Either we haven't read the column yet
3453
((i + 1 <
_sharedState
._nextColumnDataToRead) && (IsCommandBehavior(CommandBehavior.SequentialAccess))) || // Or we're in sequential mode and we've read way past the column (i.e. it was not the last column we read)
3468
if (0 <
_sharedState
._nextColumnDataToRead) {
3469
_data[
_sharedState
._nextColumnDataToRead - 1].Clear();
3477
else if (
_sharedState
._nextColumnDataToRead <
_sharedState
._nextColumnHeaderToRead) {
3482
Debug.Assert(
_sharedState
._nextColumnDataToRead ==
_sharedState
._nextColumnHeaderToRead);
3491
_SqlMetaData columnMetaData = _metaData[
_sharedState
._nextColumnHeaderToRead];
3493
if ((isSequentialAccess) && (
_sharedState
._nextColumnHeaderToRead < i)) {
3496
if (!_parser.TrySkipValue(columnMetaData,
_sharedState
._nextColumnHeaderToRead, _stateObj)) {
3500
_sharedState
._nextColumnDataToRead =
_sharedState
._nextColumnHeaderToRead;
3501
_sharedState
._nextColumnHeaderToRead++;
3506
if (!_parser.TryProcessColumnHeader(columnMetaData, _stateObj,
_sharedState
._nextColumnHeaderToRead, out isNull, out dataLength)) {
3510
_sharedState
._nextColumnDataToRead =
_sharedState
._nextColumnHeaderToRead;
3511
_sharedState
._nextColumnHeaderToRead++; // We read this one
3515
TdsParser.GetNullSqlValue(_data[
_sharedState
._nextColumnDataToRead],
3521
_sharedState
._nextColumnDataToRead++;
3525
if ((i >
_sharedState
._nextColumnDataToRead) || (!readHeaderOnly)) {
3529
if (!_parser.TryReadSqlValue(_data[
_sharedState
._nextColumnDataToRead], columnMetaData, (int)dataLength, _stateObj,
3534
_sharedState
._nextColumnDataToRead++;
3537
_sharedState
._columnDataBytesRemaining = (long)dataLength;
3548
} while (
_sharedState
._nextColumnHeaderToRead <= i);
3557
if ((_lastColumnWithDataChunkRead ==
_sharedState
._nextColumnDataToRead) && (_metaData[_lastColumnWithDataChunkRead].metaType.IsPlp)) {
3568
if ((targetColumn >=
_sharedState
._nextColumnDataToRead) && (
_sharedState
._nextColumnDataToRead <
_sharedState
._nextColumnHeaderToRead)) {
3569
if (
_sharedState
._columnDataBytesRemaining > bytesRemaining) {
3577
bytesRemaining = checked(bytesRemaining - (int)
_sharedState
._columnDataBytesRemaining);
3582
int currentColumn =
_sharedState
._nextColumnHeaderToRead;
3630
Debug.Assert(
_sharedState
._nextColumnHeaderToRead <= _metaData.Length, "_sharedState._nextColumnHeaderToRead too large");
3633
if (
_sharedState
._nextColumnDataToRead <
_sharedState
._nextColumnHeaderToRead) {
3634
if ((
_sharedState
._nextColumnHeaderToRead > 0) && (_metaData[
_sharedState
._nextColumnHeaderToRead - 1].metaType.IsPlp)) {
3647
else if (0 <
_sharedState
._columnDataBytesRemaining) {
3648
if (!_stateObj.TrySkipLongBytes(
_sharedState
._columnDataBytesRemaining)) {
3659
_sharedState
._columnDataBytesRemaining = 0;
3872
Debug.Assert(!
_sharedState
._dataReady || _metaData != null, "Data is ready, but there is no metadata?");
3873
if ((!
_sharedState
._dataReady) || (_metaData == null)) {
3885
Debug.Assert(!
_sharedState
._dataReady || _metaData != null, "Data is ready, but there is no metadata?");
3886
if ((!
_sharedState
._dataReady) || (_metaData == null)) {
3893
((
_sharedState
._nextColumnHeaderToRead > columnIndex + 1) || (_lastColumnWithDataChunkRead > columnIndex))) { // Read past column
3894
throw ADP.NonSequentialColumnAccess(columnIndex, Math.Max(
_sharedState
._nextColumnHeaderToRead - 1, _lastColumnWithDataChunkRead));
3905
Debug.Assert(!
_sharedState
._dataReady || _metaData != null, "Data is ready, but there is no metadata?");
3906
if ((!
_sharedState
._dataReady) || (_metaData == null)) {
3913
((
_sharedState
._nextColumnDataToRead > columnIndex) || (_lastColumnWithDataChunkRead > columnIndex) || // Read past column
3916
throw ADP.NonSequentialColumnAccess(columnIndex, Math.Max(
_sharedState
._nextColumnDataToRead, _lastColumnWithDataChunkRead + 1));
3922
Debug.Assert(!
_sharedState
._dataReady || _metaData != null, "Data is ready, but there is no metadata?");
3925
Debug.Assert(!requireData ||
_sharedState
._dataReady, "No data is ready to be read");
3928
Debug.Assert((!enforceSequentialAccess) || (!IsCommandBehavior(CommandBehavior.SequentialAccess)) || ((
_sharedState
._nextColumnDataToRead <= columnIndex) && (_lastColumnWithDataChunkRead <= columnIndex)), "Already read past column");
4018
Debug.Assert(
_sharedState
._nextColumnDataToRead <= _lastColumnWithDataChunkRead, "Non sequential access");
4019
if ((
_sharedState
._nextColumnHeaderToRead <= _lastColumnWithDataChunkRead) || (
_sharedState
._nextColumnDataToRead < _lastColumnWithDataChunkRead)) {
4212
if ((!_haltRead) && ((!
_sharedState
._dataReady) || (WillHaveEnoughData(_metaData.Length - 1)))) {
4218
if (
_sharedState
._dataReady) {
4337
if ((
_sharedState
._nextColumnHeaderToRead > i) && (!cancellationToken.IsCancellationRequested) && (_currentTask == null)) {
4432
if ((!IsCommandBehavior(CommandBehavior.SequentialAccess)) && (
_sharedState
._nextColumnDataToRead > i) && (!cancellationToken.IsCancellationRequested) && (_currentTask == null)) {
4683
_dataReady =
_sharedState
._dataReady,
4689
_nextColumnDataToRead =
_sharedState
._nextColumnDataToRead,
4690
_nextColumnHeaderToRead =
_sharedState
._nextColumnHeaderToRead,
4692
_columnDataBytesRemaining =
_sharedState
._columnDataBytesRemaining,
4755
_sharedState
._dataReady = _snapshot._dataReady;
4761
_sharedState
._nextColumnDataToRead = _snapshot._nextColumnDataToRead;
4762
_sharedState
._nextColumnHeaderToRead = _snapshot._nextColumnHeaderToRead;
4764
_sharedState
._columnDataBytesRemaining = _snapshot._columnDataBytesRemaining;
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (1)
370
_readerState = reader.
_sharedState
;