Posted By

krisdb on 07/28/08


Tagged

c-sharp


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


HasValue


 / Published in: C#
 

  1. /// <summary>
  2. /// Check if the object has a value
  3. /// </summary>
  4. /// <param name="o">object to be checked</param>
  5. /// <returns>boolean true/false whether it has a value.</returns>
  6. public bool HasValue(object o)
  7. {
  8. return o != null && o != System.DBNull.Value && o.ToString() != "";
  9. }

Report this snippet  

You need to login to post a comment.