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

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -