Various questions on ASPNETDB.MDF

Discussion in 'Databases' started by Holf, Jul 16, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. When creating a new Web Project using Visual Studio 2005 with SQL Server Express 2005, it seems a database file is always created called 'ASPNETDB.MDF'. This database holds Roles & Profiles info which your ASP.NET 2.0 applications may use if you are doing Personlization or Role Based Access.

    Looking at many of the SQL Server 2005 Express based exmaples I've found, it seems the general practice is to create a seperate database to hold information other than Roles & Profiles info. So you end up with two '.MDF' files: 'ASPNETDB.MDF' which holds Roles & Profiles info, and 'SOMEOTHERDB.MDF' file which holds the custom tables and data you add for your own solution.

    This means you end up with two databases. So, to useRoles & Profiles functionalityon discountASP.net, it seems to me that there are two choices:

    a) Create your own custom tables and data within the ASPNETDB.MDF database, alongside the existing Roles & Profiles tables and data. Buy a single SQL Server 2005 Instance off discountASP.net to which you can upload your ASPNET.MDF database using the 'Attach SQL' tool.
    b) Buy two seperate SQL Server 2005 database instances off discountASP.net, one for ASPNETDB.MDF and one for your own custom DB. Then you would have to use the 'Attach SQL' tool twice, once to upload each database.

    Obviously I would prefer to do a) because it is cheaper! Butare there any best practice guidelines which dictate that you should never hold anything in ASPNETDB.MDF other than Profiles & Roles information?






    And there is a further question which relates to this:


    It is possible to prepare SQL Server 2005for ASP.NET 2.0 Roles & Profiles by running a script against this database. The command used is of the format:

    aspnet_regsql.exe -S [DB Server Name] -U [DB login] -P [Password] -A all -d [Database name]

    It creates a database called 'ASPNETDB', which has a similar role to the 'ASPNETDB.MDF' database in SQL Server Express 2005.

    If I am going to use the 'Attach SQL' tool in order to upload my 'ASPNETDB.MDF' database from SQL Server 2005 Express to full blown SQL Server 2005, do I need to run this script first? I am assuming that I don't because I think all necessary tables and structures will get deployed to the full blown SQL Server 2005 isntance anyway as part of the 'Attach SQL' upload.


    Any help on either of these questions would be much appreciated. It has been a few years since I was last involved with ASP and it has all moved on quite a bit! Exciting, but there is a lot to learn!

    Thanks

    Holf
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    This KB should answer your question: http://kb.discountasp.net/article.aspx?id=10413

    We have many customer sharing a single DB between application data and the aspnet schema. You should not see any problem.




    Post Edited By Moderator (Joel Thoms) : 7/18/2006 9:30:51 PM GMT
     
  3. Thanks a lot - that's brilliant.

    [​IMG]
     
  4. Found this, which explains it all. Helps you decide if you want to keep Roles & Profiles stuff in your App Database, and how to install Roles & Profiles schema in your local App Database 'MDF' file for use in Visual Studio.


    http://aspnet.4guysfromrolla.com/articles/040506-1.aspx


    This site is full of useful information such as this. Most cool indeed.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page