Wrox Programmer Forums
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 April 2nd, 2011, 06:56 AM
Registered User
 
Join Date: Mar 2011
Posts: 7
Thanks: 4
Thanked 0 Times in 0 Posts
Unhappy Error I don't understand!!

Hi everybody,
Please help me with this error...
I'm making the relationships between database tables, and there is a relation between a table i created "UserDetails" and the "aspnet_Membership" table where the UserID in (UserDetails) is a primary key and it's a foreign key in (asp_Membership).
But when I want to save this I get this error:



/*
Saturday, April 02, 20111:48:23 PM
User:
Server: .
Database:
Application:
*/

'UserTypes' table saved successfully
'UserDetails' table saved successfully
'aspnet_Membership' table
- Unable to create relationship 'FK_aspnet_Membership_UserDetails'.
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_aspnet_Membership_UserDetails". The conflict occurred in database "C:\USERS\RUBA\DOCUMENTS\VISUAL STUDIO 2010\PROJECTS\PROJECT1\FIRST\SITE\APP_DATA\ASPNETD B.MDF", table "dbo.UserDetails", column 'UserID'.
 
Old April 2nd, 2011, 07:13 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Heuh? Aren't we discussing this here already: Error I don't understand

And what about:

Quote:
That said, on which column in the membership table are you joining? Maybe it has already some constraints set?
Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old April 2nd, 2011, 08:29 AM
Registered User
 
Join Date: Mar 2011
Posts: 7
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Heuh? Aren't we discussing this here already: Error I don't understand

And what about:



Cheers,

Imar
I know, but you told me to discuss it at another forum
 
Old April 2nd, 2011, 08:30 AM
Registered User
 
Join Date: Mar 2011
Posts: 7
Thanks: 4
Thanked 0 Times in 0 Posts
Default

I join to UserId column
 
Old April 3rd, 2011, 08:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I know, but you told me to discuss it at another forum
Yes, I know. But you just copied and pasted the question without answering the questions I was asking. So I didn't see any value in the new post.

That said, it looks like you're relating on the Primary key of the membership table. You can't make this column the primary key, an identity and a foreign key at the same time.

Why not do it the other way around (which is what you want anyway): e.g make aspnet_Membership.UserId the primary key and add it as a foreign key in your own table?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Rabruba (April 9th, 2011)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error I don't understand Rabruba BOOK: Beginning ASP.NET 4 : in C# and VB 1 April 1st, 2011 09:38 AM
Please help me understand SeanDunn BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 3 November 14th, 2009 02:38 PM
I don't understand... jmsherry ASP.NET 2.0 Basics 17 July 23rd, 2007 12:28 PM
I still do not understand aude_poullain ASP.NET 1.0 and 1.1 Basics 2 February 7th, 2007 09:11 PM
i can't understand this error! ion Classic ASP Databases 2 September 23rd, 2003 03:57 PM





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