p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 25th, 2006, 01:45 PM
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Accounts module - adding new users

Hello

I am confused about some of the code in the Accounts module about how to create a new User.

The data tier has a class called User with a method called Create. This method calls a stored procedure that inserts a user into the database. The method catches any sql exceptions thrown by calling the stored procedure and sees if they have error number 2601 which is 'cannot insert duplicate key row.'

I dont understand how the stored procedure could ever generate this error because the primary key for the users table is an autonumber field.

Please can you explain where this error could be generated. I thought there might be a unique constraint on the email field perhaps but I couldn't see one.

Thanks a lot
andrea

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old June 27th, 2006, 12:07 AM
Friend of Wrox
Points: 1,883, Level: 17
Points: 1,883, Level: 17 Points: 1,883, Level: 17 Points: 1,883, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need to look at the unique index on email (if I remember correctly). A dupe can be generated by any column that has a unique index.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Users with accounts PankajGarg10 General .NET 0 April 13th, 2007 02:06 AM
news module - adding new categories andieje BOOK: ASP.NET Website Programming Problem-Design-Solution 3 June 30th, 2006 08:55 PM
manage users accounts momo BOOK: Professional ASP.NET 2.0 Security, Membership, and Role Management ISBN: 978-0-7645-9698-8 10 April 28th, 2006 05:21 AM
create users/deleting users in active directory sara_1981 ASP.NET 1.1 3 October 11th, 2004 12:06 AM
Dreamweaver MX Chapter 14 Adding Editing users pat BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 1 August 19th, 2003 03:15 PM



All times are GMT -4. The time now is 02:45 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc