ASP.NET Membership Database: Relationships and UniqueIdentifiers

Posted on 2009-05-01
Last Modified: 2012-05-06
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?

Question by:iammrkcohen
    LVL 18

    Assisted Solution

    "should I have everything in one central database?" Yes
    here how to do this

    Author Comment

    Sounds good. Any insight into building the relationship? Will this be automatic if all tables are in one database?
    LVL 18

    Accepted Solution

    I usually link the tables user using the Aspnet_user.LoweredUserName to link from "my" tables to the 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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now