unique insert using aspx vb and sql2005
unique insert using aspx vb and sql2005
am 29.01.2008 19:57:41 von Jim
I'm using framework 3.5, aspx vb and sql server 2005. I have a form that
inserts user names. I don't want duplicate names, so how can I make a field
be unique?
Thanks.
Re: unique insert using aspx vb and sql2005
am 30.01.2008 10:50:48 von Eliyahu Goldin
User names are not something that is usually generated automatically. So I
would say you just need to validate every new name by trying to select an
existing record with the same name. If it exists, ask the user to provide
another name.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Jim" wrote in message
news:OPyZQjqYIHA.3400@TK2MSFTNGP03.phx.gbl...
> I'm using framework 3.5, aspx vb and sql server 2005. I have a form that
> inserts user names. I don't want duplicate names, so how can I make a
> field be unique?
>
> Thanks.
>
Re: unique insert using aspx vb and sql2005
am 30.01.2008 16:47:26 von David Bending
Agreed. You should also make the username a unique index in the database
and catch the exception that will be thrown if you attempt to insert a
duplicate name.
David
Senior Consultant
"Eliyahu Goldin" wrote in
message news:e4t00WyYIHA.4448@TK2MSFTNGP03.phx.gbl...
> User names are not something that is usually generated automatically. So I
> would say you just need to validate every new name by trying to select an
> existing record with the same name. If it exists, ask the user to provide
> another name.
>
> --
> Eliyahu Goldin,
> Software Developer
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
> http://usableasp.net
>
>
> "Jim" wrote in message
> news:OPyZQjqYIHA.3400@TK2MSFTNGP03.phx.gbl...
>> I'm using framework 3.5, aspx vb and sql server 2005. I have a form that
>> inserts user names. I don't want duplicate names, so how can I make a
>> field be unique?
>>
>> Thanks.
>>
>
>
Re: unique insert using aspx vb and sql2005
am 31.01.2008 17:57:37 von Jim
Thanks for the replies, but I mistyped. I put that I want unique user
names, but what I ment to type was part names. I have a table of parts and I
don't want the names to have duplicates. I see in VSE2008 there are
validation controls, but is there one for unique?
Thanks again.
"David Bending" wrote in message
news:E3185BE7-A47C-4BFB-B663-3EDF2E7C3540@microsoft.com...
> Agreed. You should also make the username a unique index in the database
> and catch the exception that will be thrown if you attempt to insert a
> duplicate name.
>
> David
> Senior Consultant
>
> "Eliyahu Goldin" wrote in
> message news:e4t00WyYIHA.4448@TK2MSFTNGP03.phx.gbl...
>> User names are not something that is usually generated automatically. So
>> I would say you just need to validate every new name by trying to select
>> an existing record with the same name. If it exists, ask the user to
>> provide another name.
>>
>> --
>> Eliyahu Goldin,
>> Software Developer
>> Microsoft MVP [ASP.NET]
>> http://msmvps.com/blogs/egoldin
>> http://usableasp.net
>>
>>
>> "Jim" wrote in message
>> news:OPyZQjqYIHA.3400@TK2MSFTNGP03.phx.gbl...
>>> I'm using framework 3.5, aspx vb and sql server 2005. I have a form
>>> that inserts user names. I don't want duplicate names, so how can I
>>> make a field be unique?
>>>
>>> Thanks.
>>>
>>
>>