I'm building a web application in ASP.NET and I want to separate it into three layers: Presentation, Data and Business.
I want to keep my database in the Data layer but I can't figure out a way to do that with the ASP.NET Memberships database (ASPNETDB.mdf).
Is there any way to tell the site to reference 开发者_StackOverflow中文版a database file in another project?
You can't reference the DB in another project to my knowledge. If your DB was in SQL Server instead of in the app_data you could call it from any project....
You can create/recreate the database using the aspnet_regsql.exe if needed.
Since you are wanting to tier you should look at having the presentation tier call the business tier to authenticate which calls the data tier ultimately to check authentication and rights. If you do this then the presentation tier won't need a reference to the DB.
精彩评论