Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / January 2008

Tip: Looking for answers? Try searching our database.

unique insert using aspx vb and sql2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim - 29 Jan 2008 18:57 GMT
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.
Eliyahu Goldin - 30 Jan 2008 09:50 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.