Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

guid showing as 00000000-0000-0000-0000-000000000000 ?

Posted on 2008-10-13
5
Medium Priority
?
3,499 Views
Last Modified: 2012-05-05
hi,

im using guids.

when i try to view in debug or use response.write i only ever get:
00000000-0000-0000-0000-000000000000

i know the guid is working but how can i view its value?
0
Comment
Question by:scm0sml
5 Comments
 
LVL 3

Expert Comment

by:DrunkenELF
ID: 22705876
Use UUIDGEN or GUIDGEN to generate your own guid.

00000000-0000-0000-0000-000000000000
Null guid is just a placeholder.
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 22705889

Dim guidResult as String = System.Guid.NewGuid().ToString()

Open in new window

0
 
LVL 9

Expert Comment

by:HeoQue
ID: 22705901
the following vb.net code will generate a random guid:

Dim myGuid As Guid = Guid.NewGuid()

Open in new window

0
 
LVL 5

Accepted Solution

by:
harwantgrewal earned 2000 total points
ID: 22707505
Hi scm0sml
Result of below code is
MY GUID = 1088729d-124d-4d0e-b5f3-d9ac36d787bb

Result of next code is
MY GUID = e7bb3880-9594-48a3-bf13-818c7c60d079

Harry
    protected void Page_Load(object sender, EventArgs e)
    {
        Guid _myGUID = new Guid("1088729d-124d-4d0e-b5f3-d9ac36d787bb");
        Response.Write("MY GUID = " + _myGUID.ToString());
        
        Guid _myGUID = Guid.NewGuid();
        Response.Write("MY GUID = " + _myGUID.ToString());
 
    }

Open in new window

0
 

Author Comment

by:scm0sml
ID: 22713123
i didnt want to generate a new guid i juyst wanted to be able to view it as it wasnt showing up in code as anything other than the place holder.

harwantgrewals answer did the trick:
Guid _myGUID = new Guid("1088729d-124d-4d0e-b5f3-d9ac36d787bb"); replacing the guid with a string variable
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

971 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