Creating the SQL Membership Provider database on your computer running SQL Server
在vs2008提供命令行下运行aspnet_regsql.exe 则会自动生成存储用户信息表
Membership Web.Config配置:
Database链接字符串:
<connectionStrings>
<add name="DefaultConnectionstrings" connectionString="data source=.\sqlexpress;integrated security=SSPI;database=MembershipTest;pooling=true" providerName="System.Data.SqlClient" /> </connectionStrings>
Merbership配置:
<membership>
<providers>
<add connectionStringName="DefaultConnectionstrings" applicationName="MembershipTestService"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true"
requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10" name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" />
</providers>
</membership>
启动缓存依赖:
若要设置 SQL 缓存依赖项,您需要具有管理特权,或管理帐户和密码。下面的命令为 Northwind 数据库中的 Employees 表启用 SQL 缓存依赖项。
aspnet_regsql.exe -S <Server> -U <Username> -P <Password> -ed -d Northwind -et -t Employees
示例:下面的命令为 MembershipTest数据库中的 registers表启用 SQL 缓存依赖项。
在vs2008提供命令行下运行aspnet_regsql.exe
d:\tools\vs2010\vs2008 Install\VC>aspnet_regsql.exe -S .\sqlexpress -U sa -P Carl123 -ed -d MembershipTest -et –t registers
按Enter:
Enabling the database for SQL cache dependency.
Finished.
Enabling the table for SQL cache dependency.
详细参考:http://www.cnblogs.com/QinBaoBei/archive/2010/03/01/1675659.html
http://blog.csdn.net/dadou2007/archive/2008/03/10/2164944.aspx
http://www.cnblogs.com/microred/archive/2009/08/21/1551023.html
Finished.