diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlDataReader.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlDataReader.cs index a918f61a1f..0482fab190 100644 --- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlDataReader.cs +++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlDataReader.cs @@ -3054,7 +3054,7 @@ virtual public int GetSqlValues(object[] values) for (int i = 0; i < copyLen; i++) { - values[_metaData.GetVisibleColumnIndex(i)] = GetSqlValueInternal(i); + values[i] = GetSqlValueInternal(_metaData.GetVisibleColumnIndex(i)); } return copyLen; } @@ -3500,7 +3500,7 @@ override public int GetValues(object[] values) // If this is sequential access, then we need to wipe the internal buffer if ((sequentialAccess) && (i < maximumColumn)) { - _data[i].Clear(); + _data[fieldIndex].Clear(); if (fieldIndex > i && fieldIndex > 0) { // if we jumped an index forward because of a hidden column see if the buffer before the