I recently came across two seemingly equivalent ways to get a string from an IDataReader (assume reader
implements the IDataReader
interface):
reader.GetString(1)
reader[4] as string
Why would you use the "array index" method vs the "Get" method? What's the difference between the two approaches?