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.
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.

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
> 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.
David Bending - 30 Jan 2008 15:47 GMT
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
> 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
[quoted text clipped - 6 lines]
>>
>> Thanks.
Jim - 31 Jan 2008 16:57 GMT
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.
> 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
[quoted text clipped - 13 lines]
>>>
>>> Thanks.