Link to home
Start Free TrialLog in
Avatar of mattphung
mattphung

asked on

How do I check if a GUID is nothing or null?

How do I check if a GUID is nothing or null?
Is there a built in function lfor this?
ASKER CERTIFIED SOLUTION
Avatar of Solar_Flare
Solar_Flare

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mattphung
mattphung

ASKER

i tried:
if objGUID = nothing then
 
I get an error message "=" is not defined for type "system.GUID"

why does " Isnothing()" works but "= nothing" doesn't?
in VB.NET you can't compare an object ot nothing like that. You should also be able to use

if objGUID is nothing then


but the same applies, you cant use =nothing like you can use == null in c#
Avatar of Bob Learned
C#:
   if (guidVariable == Guid.Empty)

VB.NET:
  If guidVariable.Equals(Guid.Empty) Then

Bob