Reputation: 3975
I have set up a ASP.net MVC application which uses the default forms authentication. It uses the ASPNETDB.mdf like shown here:
I then set up another database connection which is similar to the NerdDinner.mdf file above.
I have a post that belongs to a user. It has a UserId value which needs to be a foreign key to the information in ASPNETDB.mdf. When I go to add a foreign key, I can only see information with regards to the table I made. How do I go about doing this?
Upvotes: 1
Views: 1585
Reputation: 498972
Even if it were possible (which is isn't), this would be a bad idea - chaining databases in this manner would only cause problems down the line.
From MSDN:
A FOREIGN KEY constraint can reference columns in tables in the same database or within the same table.
(emphasis mine)
Upvotes: 3