Solved

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

Posted on 2008-10-13
5
3,201 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
Comment Utility
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
Comment Utility

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

Open in new window

0
 
LVL 9

Expert Comment

by:HeoQue
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now