Submitting form with a unique ID

  • Thread starter Thread starter James Brown
  • Start date Start date
J

James Brown

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... 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.<
 
Using a system generated GUID is quick and easy, although kinda long.
16 bytes minimum.
 
Back
Top