![vs%202005%20pd7.jpg](https://i-blog.csdnimg.cn/blog_migrate/e7f0812b76e28844561fa70048d52ead.jpeg)
发现在
![asp.net%20tool.jpg](https://i-blog.csdnimg.cn/blog_migrate/0a56c91d8ca0e5f38a40904652c14e85.jpeg)
![SQL%202005.jpg](https://i-blog.csdnimg.cn/blog_migrate/f984f0043b88281eaebb12a7e09840a6.jpeg)
记得在上几个版本的CTP中支持在 Web Site Administration Tool 中添加SQL 链接与数据库,而在该版本中并没有,不是否是安装 VS 2005时没有安装SQL 2005 Express(因为之前已经安装了 SQL 2005 Pro .Net FW与VS2005一致)。
继续在MSDN中找资料,发现如下文字:
Configuring the SQL Server Provider
If you want to use AspNetSqlProvider to store application feature data in a SQL Server database, you must first configure SQL Server by creating the appropriate database. ASP.NET includes a command-line utility named aspnet_regsql.exe
that performs this task for you.
The aspnet_regsql.exe executable is located in the C:\WINDOWS\Microsoft.NET\Framework\versionNumber folder on your Web server. The aspnet_regsql.exe
command is used to both create the SQL Server database and to add or remove options from an existing database.
You can run the aspnet_regsql.exe
executable without any command-line arguments to run a wizard that will walk you through specifying connection information for SQL Server and installing or removing the database elements for all of the supported features. You can also run the aspnet_regsql.exe executable as a command-line utility to configure database elements for individual features.
To run the aspnet_regsql.exe
wizard, run the aspnet_regsql.exe
executable without any command-line arguments as shown in the following example.
C:\WINDOWS\Microsoft.NET\Framework\versionNumber\aspnet_regsql.exe
To view help for additional options available with the aspnet_regsql.exe utility, use the /?
option.
随后启动aspnet_regsql.exe
安提示,最后数据库中将自动添加多个表、视图与存储过程如下:
自此,AspNetSqlProvider配置完毕
可以正常连接数据库与测试
不知道是我愚笨还是beta版本的问题,设置起来的确麻烦,因此写下来免得遇到同类问题的朋友浪费之间
另:如何配置SQLEXPRESS的 AspNetSqlMembershipProvider 链接,就是实现想access那样可以安相对目录配置mdf数据库,我配置没有成功,如果配置成功的请指教
我的链接语句如下:Data Source=.\SQLEXPRESS;AttachDbFilename=~\App_Data\AspnetDB.mdf;Integrated Security=True
链接数据库没有问题,但是无法实现AspNetSqlMembershipProvider