none
ASPNETDB.mdf & SQL Server 2008 R2 Express RRS feed

  • Question

  • Please help!!

    I am using Visual Web Developer 2010 Express to develop web site.  It generates a ASPNETDB.mdf when using login, etc.  How can I access this database.  Have SQL Server 2008 R2 Express on my PC. 

    I want to link existing SQL Server 2008 R2 Express db to this one, ie to display listings for user logged into web site.  How do I do this?

    Thanks!!

    Wednesday, September 8, 2010 1:03 PM

Answers

  • Hi,

    Thanks for your posting!

    Based on my testing, Visual Web Developer (VWD) 2010 Express ships SQL Server 2008 Express Edition SP1 (not SQL Server 2008 R2 Express Edition), which should be installed if it is selected during the VWD installation.

    The ASPNETDB database file is used for ASP.NET web applications role management (SqlRoleProvider). By default, roles are store in a database named ASPNETDB database in a SQL Server Express database instance in the \app_data folder beneath your application's virtual directory root folder. You can also configure the SqlRoleProvider to use a local or remote instance of SQL Server.

    If you use the first means to store roles (\app_data), the ASPNETDB will be attached using a user instance (SQLEXPRESS) of SQL Server 2005 Express or 2008 Express (must be installed first before register ASPNETDB like this and couldn't use SQL Server 2008 R2 Express). In this way, you can open the tables in the ASPNETDB database by double-click \app_data\ASPNETDB.mdf.

    If you want to use SQL Server 2008 R2 Express to store roles, you can use the second means to register ASPNETDB on the instance of SQL Server 2008 R2 Express. After registering, you can use SQL Server Management Studio (or Express version) or use VWD to connect this instance and open tables within ASPNETDB.

    For how to configure ASPNETDB, please refer to How To: Use Role Manager in ASP.NET 2.0 which should also work for VWD 2010 Express.

    If you have more questions, please feel free to let me know.

    Thanks,
    Chunsong


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, September 10, 2010 8:19 AM
    Moderator