msaravanan
February 12th, 2008, 01:21 AM
how to check whether an object/string exist....
if possible help me with a code
if possible help me with a code
|
Click to See Complete Forum and Search --> : NULL object in vb.net msaravanan February 12th, 2008, 01:21 AM how to check whether an object/string exist.... if possible help me with a code WoF February 12th, 2008, 09:28 AM 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. GremlinSA February 12th, 2008, 10:23 AM 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.. (http://www.codeguru.com/vb/vbnet30/article.php/c13373/) Gremmy.. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |