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 infor开发者_如何学Pythonmation 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.
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
精彩评论