When returning data from a DataReader
I would typically use the ordinal reference on the DataReader
to grab the relevant column:
if
The problem with ordinal is if the order of the columns change and you are forced to modify the consumer code for the DataReader, unlike using column names.
I dont think there is a performance gain when using ordinal or column names, it is more on best practice and coding standards and code maintainability really