none
New Guid Issue RRS feed

  • Question

  • Hi all,

    I am unable to find out what's wrong with the code.

    dim gid as Guid = Guid.newguid()

    still I am getting gid as empty object.

    can somebody tell me why this is happening? it really urgent.

    Regards,
    Prabi
    Monday, December 15, 2008 6:13 AM

Answers

  • Are you sure it's empty?  Try this:

    Dim gid As Guid = Guid.NewGuid()
    Console.WriteLine(gid)

    • Marked as answer by Zhi-Xin Ye Friday, December 19, 2008 11:27 AM
    Monday, December 15, 2008 8:19 AM

All replies

  • Hi Prabi,

    Is this happening in C# / VB.Net?

    If its C# then can u try with  the below code..

    Guid        guid = Guid.NewGuid();

    I think u have used wrong case.

    Thanks!!

    Regards,
    Jagadeesh.

    Monday, December 15, 2008 8:00 AM
  • Are you sure it's empty?  Try this:

    Dim gid As Guid = Guid.NewGuid()
    Console.WriteLine(gid)

    • Marked as answer by Zhi-Xin Ye Friday, December 19, 2008 11:27 AM
    Monday, December 15, 2008 8:19 AM
  • I am extremely sorry for opening this thread.

    Actually I was doing some other things that causing the problem.

    Thank you very much for you help..

    Regards,
    Prabi
    Monday, December 15, 2008 9:21 AM
  • It still says it's empty, doesn't it?
    Monday, December 15, 2008 9:39 AM
  •  Actually at debugging time when I move mouse over the variable it shows me empty but when I do

    Console.writeline(guid)

    then it shows the value..

    Sorry again..

    regards,
    Prabi
    Tuesday, December 16, 2008 4:01 AM
  • That was the point of my post.  Why does it say it's empty when it isn't?
    Tuesday, December 16, 2008 5:15 AM