Submitting form with a unique ID

Discussion in 'ASP .Net' started by James Brown, Jul 5, 2003.

  1. James Brown

    James Brown Guest

    Hi All,

    I'm looking for some information/code samples on how I can create a
    simple web form that includes an auto-generated Unique ID on the form.

    The form includes the following 3 fields (Unique ID, First Name and
    Last Name). I have a SQL Server 2000 back-end with the table created
    as follows:

    UniqueID - numeric (9)
    FirstName - varchar (50)
    LastName - varchar (50)

    Ideally I would like the user just to enter their First and Last Name
    and the form automatically creates a Unique ID for them. Once they
    type in their First/Last Name the user submits the information to the
    database. I've managed to get the web form created so that it submits
    the First/Last Name successfully but I can't think how to create the
    Unique ID, ideally I'd like this to be based around the time/date of
    submittal.

    Any guidance would be much appreciated.

    Thanks

    Scott
     
    James Brown, Jul 5, 2003
    #1
    1. Advertising

  2. James Brown

    Jeff Louie Guest

    James... If you declare an IDENTITY column, SQL will return a
    uniqueID upon INSERT. If you want to generate your own
    uniqueID you could do a concatenation of the MAC address of the
    client ethernet card plus a timestamp.

    Regards,
    Jeff
    >I've managed to get the web form created so that it submits

    the First/Last Name successfully but I can't think how to create the
    Unique ID, ideally I'd like this to be based around the time/date of
    submittal.<


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Jeff Louie, Jul 5, 2003
    #2
    1. Advertising

  3. James Brown

    David Waz... Guest

    Using a system generated GUID is quick and easy, although kinda long.
    16 bytes minimum.



    "James Brown" <> wrote in message
    news:...
    > Hi All,
    >
    > I'm looking for some information/code samples on how I can create a
    > simple web form that includes an auto-generated Unique ID on the form.
    >
    > The form includes the following 3 fields (Unique ID, First Name and
    > Last Name). I have a SQL Server 2000 back-end with the table created
    > as follows:
    >
    > UniqueID - numeric (9)
    > FirstName - varchar (50)
    > LastName - varchar (50)
    >
    > Ideally I would like the user just to enter their First and Last Name
    > and the form automatically creates a Unique ID for them. Once they
    > type in their First/Last Name the user submits the information to the
    > database. I've managed to get the web form created so that it submits
    > the First/Last Name successfully but I can't think how to create the
    > Unique ID, ideally I'd like this to be based around the time/date of
    > submittal.
    >
    > Any guidance would be much appreciated.
    >
    > Thanks
    >
    > Scott
     
    David Waz..., Jul 6, 2003
    #3
    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. Dave Smithz
    Replies:
    3
    Views:
    34,653
    mokker
    Oct 30, 2009
  2. ToshiBoy
    Replies:
    6
    Views:
    854
    ToshiBoy
    Aug 12, 2008
  3. Marco Alting
    Replies:
    7
    Views:
    518
    Thomas 'PointedEars' Lahn
    Oct 30, 2003
  4. Kai Grossjohann
    Replies:
    4
    Views:
    283
  5. Token Type
    Replies:
    9
    Views:
    362
    Chris Angelico
    Sep 9, 2012
Loading...

Share This Page