Using the SqlDataReader class, what, if any, are the functional differences between:
(string) dataReader[\"MyFieldName\"];
and
//Well, we want to avoid the null exception issue entirely.
//Let's check for null first, before we try to use the value.
if( !dataReader.IsDBNull(dataReader.GetOrdinal("MyFieldName")))
{
//Store my data or use the value
string mystring=dataReader.GetString(dataReader.GetOrdinal("MyFieldName"));
}
Serendipity is a wonderful discovery method.