Creating a UNIQUE value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Pope

    Creating a UNIQUE value

    I need to create a UNIQUE number similar to a GUID but all numbers. Does
    anyone know of an algorithm or anything?

    TIA,

    Dave


  • Vishnu-Chivukula

    #2
    RE: Creating a UNIQUE value

    Hi David,

    In case you are looking at how to create GUID, then the framework has a
    class called System.Guid, which does this...

    Very simple... Have a look at these links....for code snippets



    In case you want to write / use algorithm for generating the number, then
    check this link for code snippet in C#...


    HTH,

    Need any help, do post a msg back..


    Happy Coding




    "David Pope" wrote:
    [color=blue]
    > I need to create a UNIQUE number similar to a GUID but all numbers. Does
    > anyone know of an algorithm or anything?
    >
    > TIA,
    >
    > Dave
    >
    >
    >[/color]

    Comment

    • Felipe

      #3
      Re: Creating a UNIQUE value

      Hi David

      How about System.DateTime .Now.Ticks

      it gives you a unique number as long as the number is not created too
      rapidily.....

      just an idea....

      "David Pope" <dpope@nospam.s atx.rr.com> wrote in message
      news:uRUXKP2EFH A.936@TK2MSFTNG P12.phx.gbl...[color=blue]
      >I need to create a UNIQUE number similar to a GUID but all numbers. Does
      >anyone know of an algorithm or anything?
      >
      > TIA,
      >
      > Dave
      >[/color]


      Comment

      Working...