Getting field index from field name using sqlDataReader
Im trying to find a quick way of getting the field number from just having the field name using sqlClient.sqlDataReader.
I could do a loop though each field untill I reach the correct field then pass back the index number, but I was wonder if there was an easier way?
[example - my current solution]
Function ReturnFieldIndex(byval Name as String, byval DataReader as sqlClient.sqlDataReader) as Integer
For a = 0 To DataReader.FieldCount - 1
If DataReader.GetName(a) = Name Then
Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.