Solved

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

Posted on 2008-10-13
5
3,342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 500 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

734 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