?
Solved

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

Posted on 2007-07-19
4
Medium Priority
?
7,800 Views
Last Modified: 2008-02-01
How do I check if a GUID is nothing or null?
Is there a built in function lfor this?
0
Comment
Question by:mattphung
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Solar_Flare earned 375 total points
ID: 19527121
just use the usual check for nothing/null

c#: if (objGUID == null)
vb: if IsNothing(objGUID) then
0
 

Author Comment

by:mattphung
ID: 19527303
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?
0
 
LVL 15

Expert Comment

by:Solar_Flare
ID: 19528026
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#
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19530989
C#:
   if (guidVariable == Guid.Empty)

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

Bob
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Loops Section Overview
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month14 days, 2 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question