Wrox Programmer Forums
|
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 Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 25th, 2006, 12:45 PM
Registered User
 
Join Date: Jun 2006
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

 
Old June 26th, 2006, 11:07 PM
Friend of Wrox
 
Join Date: Jun 2003
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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Users with accounts PankajGarg10 General .NET 0 April 13th, 2007 01:06 AM
news module - adding new categories andieje BOOK: ASP.NET Website Programming Problem-Design-Solution 3 June 30th, 2006 07:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.