DataReader best-practices -
Similar, but the answer was never found in what I really wanted to know about. Is there any criteria about obtaining value from a dotderer? I.e., is
dataReader.GetString (dataReader.GetOrdinal ("ColumnName"));
Is this considered as better / worse / similar?
(string) data reader ["columnname"];
Here's how I do:
Difference 32 Serial = Data Reader Getordinal ("column name"); If (DataReader.IsDBNull (ordinal)) yourString = dataReader.GetString (sortable); It is important to check DBNull
as I have shown above because if the field is zero in the DataReader
then this is an exception when you Try to recover.
Comments
Post a Comment