tags:

views:

27

answers:

1

I created a table(UserProfile) to store additional user info and create foreign key relationship btw UserId of UserProfile table & asp.net_Users table.

When i run the createuser page i have this error:

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_User_Profile_aspnet_Users1". "dbo.aspnet_Users", column 'UserId'. The statement has been terminated.

thanks for your help

A: 

Since you are using the Web Site project template, you have user profiles out of the box and should not need to manually link to the membership system by creating your own tables/foreign keys. You don't need to write any specific code to store the extra user profile info in the database - the profile system does this for you.

http://msdn.microsoft.com/en-us/library/2y3fs9xs.aspx

http://www.4guysfromrolla.com/articles/101106-1.aspx

http://odetocode.com/articles/440.aspx

IrishChieftain
thanks for thr link.
prince
thanks for d links.My reason 4 creating userprofile table is default sql profile provider present data in non -searchable form.I want a situation where i will be able to query profile data
prince
Here's how you can do that: http://weblogs.asp.net/scottgu/archive/2006/01/10/435038.aspx
IrishChieftain
thanks 4 d link
prince