DataReader with double column names
What is the best way to handle trying to get data from a DataReader with more than one column of the same name?
Due to the amount of work involved and because we don't want to lose vendor support by changing the stored procedures we use to retrieve data, I'm trying to find another way to access a column that appears more than once in a datareader without the need to rewrite stored procedures.
Any ideas?
EDIT: Okay, the function that is actually populated from the datareader is used in multiple places, so there is a possibility that the function could be called by different stored procedures. What I did was do GetName using the index to check if it is the correct column and if so, pull out its value.
+1
source to share
3 answers