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
    Aug 2002
    Posts
    33

    null object

    How can I validate the object before accessing it? The IsNull is not available under asp .net version.

    I try to see if the treenode exist in the treeview or not.

    Here is my code:

    dim userNode as TreeNode = TreeViewInbound.GetNodeFromIndex (strUser)

    Thanks for the information

  2. #2
    Join Date
    Aug 2002
    Posts
    33
    Damm,
    I got it!!!. It suppose to be

    if (treeNode is Nothing) then
    ...
    end if

    instead of
    if (treeNode = Nothing) then
    ...
    end if

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