When accessing values from an SqlDataReader is there a performance difference between these two:
string key = reader.GetString("Key");
or
string key = reader["Key"].ToString();
In this code sample:
string key;
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
key = reader.GetString("Key");
// or
key = reader["Key"].ToString();
}
}