Method GetNames
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
GetNames(IDataRecord)
Gets all the column names of the current result set in ordinal order.
public static ImmutableArray<string> GetNames(this IDataRecord record)
Parameters
recordIDataRecordThe record to get the column names from.
Returns
- ImmutableArray<string>
An immutable array of column names.
Exceptions
- ArgumentNullException
recordis null.
- See Also
GetNames(IDataRecord, IEnumerable<int>)
Gets the column names at the specified ordinals.
public static ImmutableArray<string> GetNames(this IDataRecord record, IEnumerable<int> ordinals)
Parameters
recordIDataRecordThe record to get the column names from.
ordinalsIEnumerable<int>The ordinals to look up. The names are returned in this order.
Returns
- ImmutableArray<string>
An immutable array of column names, one for each ordinal.
Exceptions
- ArgumentNullException
recordis null.- IndexOutOfRangeException
An ordinal is not a valid column index for the record.