I am building an ASP.NET 3.5 (C#) application and I plan to use the membership and roles security.
我正在构建一个ASP.NET 3.5(C#)应用程序,我计划使用成员资格和角色安全性。
I want to set this up on my SQL Server 2008 standard edition and not the default express setting.
我想在我的SQL Server 2008标准版上进行设置,而不是默认的快速设置。
How would I go about this?
我怎么会这样呢?
4 个解决方案
#1
It doesn't matter wich database server version you are using for the ASP.NET security membership/role module, apart from being SQL Server.
除了是SQL Server之外,您使用的ASP.NET安全成员资格/角色模块的数据库服务器版本并不重要。
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).
并相应地配置web.config(请参阅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.
您可以使用存储数据的相同数据库来运行此脚本,也可以创建新数据库来存储用户成员资格或角色相关数据并在那里运行它们。
#2
You can install membership database with this command aspnet_regsql.exe at *C:\Windows\Microsoft.NET\Framework\v2.0.50727* (adjust to your path)
您可以使用此命令aspnet_regsql.exe在* C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 *(根据您的路径调整)安装成员资格数据库
You can find more details here
你可以在这里找到更多细节
#3
you need to run aspnet_regsql. That will popup the wizard to configure your new database.
你需要运行aspnet_regsql。这将弹出向导以配置新数据库。
#4
- Take the MDF and LDF files created by Express Edition (usually in App_Data) and Attach them to your SQL Server 2008 Instance.
- 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)
- Change the connection string in your web.config to point to the new database
获取Express Edition创建的MDF和LDF文件(通常在App_Data中)并将它们附加到SQL Server 2008实例。
为新数据库设置安全性(即将用户添加到将访问数据库的数据库。确保为用户提供适当的权限)
更改web.config中的连接字符串以指向新数据库
Edit: My answer assumes that you're already using your database and just want to migrate it from SQL Express to SQL Standard edition.
编辑:我的回答是假设您已经在使用数据库并且只想将其从SQL Express迁移到SQL标准版。
#1
It doesn't matter wich database server version you are using for the ASP.NET security membership/role module, apart from being SQL Server.
除了是SQL Server之外,您使用的ASP.NET安全成员资格/角色模块的数据库服务器版本并不重要。
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).
并相应地配置web.config(请参阅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.
您可以使用存储数据的相同数据库来运行此脚本,也可以创建新数据库来存储用户成员资格或角色相关数据并在那里运行它们。
#2
You can install membership database with this command aspnet_regsql.exe at *C:\Windows\Microsoft.NET\Framework\v2.0.50727* (adjust to your path)
您可以使用此命令aspnet_regsql.exe在* C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 *(根据您的路径调整)安装成员资格数据库
You can find more details here
你可以在这里找到更多细节
#3
you need to run aspnet_regsql. That will popup the wizard to configure your new database.
你需要运行aspnet_regsql。这将弹出向导以配置新数据库。
#4
- Take the MDF and LDF files created by Express Edition (usually in App_Data) and Attach them to your SQL Server 2008 Instance.
- 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)
- Change the connection string in your web.config to point to the new database
获取Express Edition创建的MDF和LDF文件(通常在App_Data中)并将它们附加到SQL Server 2008实例。
为新数据库设置安全性(即将用户添加到将访问数据库的数据库。确保为用户提供适当的权限)
更改web.config中的连接字符串以指向新数据库
Edit: My answer assumes that you're already using your database and just want to migrate it from SQL Express to SQL Standard edition.
编辑:我的回答是假设您已经在使用数据库并且只想将其从SQL Express迁移到SQL标准版。