How do I change my asp.net membership database from express to standard sql?

前端 未结 4 545
陌清茗
陌清茗 2020-12-21 16:01

I am building an ASP.NET 3.5 (C#) application and I plan to use the membership and roles security.

I want to set this up on my SQL Server 2008 standard edition and n

相关标签:
4条回答
  • 2020-12-21 16:03

    You can install membership database with this command aspnet_regsql.exe at *C:\Windows\Microsoft.NET\Framework\v2.0.50727* (adjust to your path)

    You can find more details here

    0 讨论(0)
  • 2020-12-21 16:23
    1. Take the MDF and LDF files created by Express Edition (usually in App_Data) and Attach them to your SQL Server 2008 Instance.
    2. Setup security for the new database (i.e. add a user to the database that will access the database. Make sure to give the appropriate permissions to the user)
    3. Change the connection string in your web.config to point to the new database

    Edit: My answer assumes that you're already using your database and just want to migrate it from SQL Express to SQL Standard edition.

    0 讨论(0)
  • 2020-12-21 16:24

    you need to run aspnet_regsql. That will popup the wizard to configure your new database.

    0 讨论(0)
  • 2020-12-21 16:28

    It doesn't matter wich database server version you are using for the ASP.NET security membership/role module, apart from being SQL Server.

    To set up manually this security on a server you have to run these scripts:

    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallCommon.sql

    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallMembership.sql

    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallRoles.sql

    and configure web.config accordingly (see http://msdn.microsoft.com/en-us/library/6e9y4s5t.aspx).

    You may run this scripts using the same database where you have your data, or you can create a new database to store user membership or role related data and run them there.

    0 讨论(0)
提交回复
热议问题