CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Null object

  1. #1
    Join Date
    Apr 2003
    Location
    Pakistan
    Posts
    42

    Null object

    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

  2. #2
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    263
    Code:
        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
    string Signature = Censored;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured