开发者

ASP.NET: Questions about ASPNETDB.MDF

in my web site i have two databases, ASPNETDB.MDF and a self created one (database.mdf). (The don't contain a lot of data yet) But i need a relationship (foreign key) between a table in ASPNETDB.MDF and a table in database.mdf.

So i guess i need to merge both databases first, would you just extend the "ASPNETDB.MDF" with the tables from "database.mdf" ? or better configure "database.mdf" for the asp.net Applicatoin Services and then delete "ASPNETDB.MDF" ? Is "ASPNETDB.MDF" even meant to be used in a production online web application?

(Right now i'm using sql server express but i will probably use 开发者_如何学编程sql server when deploying Site to a shared host)

thanks a lot for answers


the scripts for the structure that is inside ASPNETDB.MDF are deployable on a different database (http://msdn.microsoft.com/en-us/library/x28wfk74.aspx)

however, I would really consider wether or not you want to do a foreign key to those tables, the membership, roles and profile API is intended to be used as a pluggable API, something you will break by defining your foreign key


Setting up membership in existing database is something you should be looking at. If you are asking me, I will and I have created membership related data objects in my application specific database. You can find the SQL scripts to do so at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727(v4.0.30319 in case you have VS 2010).

By doing this you can create foreign keys to membership table and achieve your objective.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜