Click to See Complete Forum and Search --> : Null object


awaismalik82
June 11th, 2003, 06:37 AM
Hey guys,
How is it possible in VB .net to check whether an instance of a class has a null value or not, i.e. wht we used to do in VB6 was IsNull(objectName). I know bout IsDbNull() method in VB .net that is supposed to work just like IsNull() of VB6 but that hasnt helped me in my case. Need an answer quick.
Thanx in advance.

Awais Malik

dynamic_sysop
June 12th, 2003, 06:02 AM
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim obj As Object
obj = System.DBNull.Value '/// make obj null

MsgBox(IsDBNull(obj))
End Sub

that works like IsNull in vb6 :)