Wednesday, November 7, 2007

How to determine if a data value is null

When we try to get data using a series of SQL joins, at some point, we are bound to hit a data element with a Null value. It took me a little bit of time the first time i came across such an error. This is how i dealt with it:


If TypeOf (MyDs.Tables(0).Rows(j).Item(3)) Is System.DBNull Then
' do something here

End If

No comments: