Home DotNet Using Not zzz Is Nothing and zzz IsNot Nothing in VB.NET
Author:

How to compare object using Not variable1 Is Nothing and variable1 IsNot Nothing in VB.NET. This can be confusing but once you get the syntax right it should be ok. I was trying to compare the object and trying to determing if object is null or not.

Method 1:

If variable1 IsNot Nothing Then
 'Your code
End If


OR Method 2:

If Not variable1 Is Nothing Then
 'Your code
End If

IsNot can also use to compare the two object to determine if they are the same object.



Comments (0)
Write comment
Your Contact Details:
Comment:
Security
Please input the anti-spam code that you can read in the image.

"