Jhorra
Jhorra

Reputation: 6321

One to one relationship in Sql Server and LINQ

I have a Users table and a profile table. The reason they are separate is because information about the user can be put in before they are registered for the site. The problem I'm running into is that when I set the relationship in Sql Server it wants to create a one to many relationship. I don't see any way to change this.

Upvotes: 4

Views: 1274

Answers (1)

Marko
Marko

Reputation: 72230

I assume you're creating it using the ASP.NET Membership? If so, simply add a uniqueidentifier column inside your profiles table, set as primary key and you're good to go. SQL won't allow you to add more than 1 record for that ID.

This article provides exactly what you need http://www.asp.net/security/tutorials/storing-additional-user-information-cs

Upvotes: 2

Related Questions