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