Saturday, March 31, 2012

Submitting form with a unique ID

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

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

"James Brown" <i.m@.winning.com> wrote in message
news:1f88a50b.0307051028.3caafaf1@.posting.google.c om...
> 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

0 comments:

Post a Comment