GUID?

Discussion in 'ASP .Net' started by LL, Nov 3, 2003.

  1. LL

    LL Guest

    Hi,

    What's is function to get the GUID? Thanks,
     
    LL, Nov 3, 2003
    #1
    1. Advertising

  2. LL

    Suresh Guest

    There a Guid object that you have to instantiate and call
    it's NewGuid method.

    (in C#)
    Guid g = new Guid();
    g = g.NewGuid();

    HTH,
    Suresh.

    >-----Original Message-----
    >Hi,
    >
    >What's is function to get the GUID? Thanks,
    >
    >
    >.
    >
     
    Suresh, Nov 3, 2003
    #2
    1. Advertising

  3. LL

    Brian W Guest

    Actually, NewGuid is a static method so you can't do that.

    Instead try
    Guid g = Guid.NewGuid();

    Hope this helps
    Brian W


    "Suresh" <> wrote in message
    news:015801c3a22b$02e60bb0$...
    > There a Guid object that you have to instantiate and call
    > it's NewGuid method.
    >
    > (in C#)
    > Guid g = new Guid();
    > g = g.NewGuid();
    >
    > HTH,
    > Suresh.
    >
    > >-----Original Message-----
    > >Hi,
    > >
    > >What's is function to get the GUID? Thanks,
    > >
    > >
    > >.
    > >
     
    Brian W, Nov 3, 2003
    #3
  4. It is not necessary to create an instance of the Guid class to invoke the
    NewGuid() method. It's a static (shared) method. You can simply call:

    Guid g = Guid.NewGuid();

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big Things are made up of
    Lots of Little Things.

    "Suresh" <> wrote in message
    news:015801c3a22b$02e60bb0$...
    > There a Guid object that you have to instantiate and call
    > it's NewGuid method.
    >
    > (in C#)
    > Guid g = new Guid();
    > g = g.NewGuid();
    >
    > HTH,
    > Suresh.
    >
    > >-----Original Message-----
    > >Hi,
    > >
    > >What's is function to get the GUID? Thanks,
    > >
    > >
    > >.
    > >
     
    Kevin Spencer, Nov 3, 2003
    #4
  5. LL

    Atila B. Guest

    This should be relatively easy. Here's a C# sample:

    System.Guid myGUID = System.Guid.NewGuid();
    Response.Write(myGUID.ToString());

    >-----Original Message-----
    >Hi,
    >
    >What's is function to get the GUID? Thanks,
    >
    >
    >.
    >
     
    Atila B., Nov 4, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sky
    Replies:
    2
    Views:
    447
  2. Grey

    Create GUID

    Grey, May 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,900
    =?Utf-8?B?UmF2aWthbnRoW01WUF0=?=
    May 6, 2004
  3. Grey

    Using GUID as primary key in DB

    Grey, May 7, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    1,892
    Steve C. Orr [MVP, MCSD]
    May 7, 2004
  4. Gopal Krish
    Replies:
    3
    Views:
    5,628
    Gopal Krish
    Oct 27, 2004
  5. John Doe
    Replies:
    0
    Views:
    373
    John Doe
    Mar 6, 2005
Loading...

Share This Page