int GetValues (object [] values)
{
int numValues = 0;
if (IsClosed)
throw new InvalidOperationException ("The reader is closed.");
if (currentRow == -1)
throw new InvalidOperationException ("No data available.");
// copy values
for (int i = 0; i < values.Length; i++) {
if (i < FieldCount) {
values [i] = GetValue (i);
} else {
values [i] = null;
}
}
// get number of object instances in array
if (values.Length < FieldCount)
numValues = values.Length;
else if (values.Length == FieldCount)
numValues = FieldCount;
else
numValues = FieldCount;
return numValues;
}