Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 464
  • Last Modified:

ASP.NET Membership Database: Relationships and UniqueIdentifiers

I have created an ASP.NET application. I automatically configured membership with the built-in tools which stores all membership info in my app_data folder in a SQL express database.

Meanwhile, the rest of my data for my application is stored in a separate SQL Server database. Some fields in this database need to relate to the user table, but I can't build a relationship because the automatic configuration of the membership database sets the datatype of the UserID to UniqueIdentifier, thus I can't build a relationship.

My questions is:
1. Is this the best way to build this? Or should I have everything in one central database?
2. If this is an acceptable way to do this, how do I build the relationship?

  • 2
2 Solutions
David RobitailleAnalyst ProgrammerCommented:
"should I have everything in one central database?" Yes
here how to do this
iammrkcohenAuthor Commented:
Sounds good. Any insight into building the relationship? Will this be automatic if all tables are in one database?
David RobitailleAnalyst ProgrammerCommented:
I usually link the tables user using the Aspnet_user.LoweredUserName to link from "my" tables to the asp.net table. then i could retrieve the userID to get data from the others tables.
But it`s true that you cannot build "foreign key" relationship. But you could still link the data in a query.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now