CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2008
    Posts
    12

    Question NULL object in vb.net

    how to check whether an object/string exist....

    if possible help me with a code

  2. #2
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: NULL object in vb.net

    With an object you usually do If ObjectVar Is Nothing Then...
    A string could be checked for empty like If StringVar = vbNullString Then
    where also If StringVar = "" Then... gives the same result, I think.

  3. #3
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: NULL object in vb.net

    Quote Originally Posted by WoF
    With an object you usually do If ObjectVar Is Nothing Then...
    A string could be checked for empty like If StringVar = vbNullString Then
    where also If StringVar = "" Then... gives the same result, I think.
    100% correct.

    the only difference is a Null string has no allocated memory, and can cause errors when passed to a API.

    check under NULL's in this article for more info..

    Gremmy..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

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