Things I always forget
- Mother’s Day (sorry mum)
- My mobile phone telephone number
- The 7 times table
- How to test for Database nulls
There’s not much hope for the first three – however maybe a quick blog might help with the last one
How I always try to test for database nulls
If(drDataRow["FieldName"] == null)
{
//Nope this never works. I won’t hit this
}
How I should test for database nulls
If(drDataRow["FieldName"] is DBNull)
{
//It works! Shirt off and do the victory dance
}
Now if I can just work on those times tables ………
No comments:
Post a Comment