奇怪的 SQL Server 连接数据库错误
我正在使用 SQL Server 2008 Enterprise 和 VSTS 2008,并且正在使用 ASP.Net 和表单身份验证开发一个简单的 Web 应用程序。
当我使用我的ASP.Net项目的VSTS的配置工具/菜单时(我想使用这个工具手动添加一些Forms身份验证用户),我遇到了以下错误(SqlException),
Trying to attach file D:\Projects\MyTest\App_Data\aspnetdb.mdf to automatically named database failed. It may be caused by existing the same name database, or may be caused by specified file can not be opened or caused by the specified file exists in UNC share.
在我的计算机中,没有dir D:\Projects\MyTest\App_Data
下的 aspnetdb.mdf,为什么会搜索这个目录?在运行配置工具之前,我已经使用aspnet_regsql成功生成了数据库。为什么会出现这样的错误呢?如何修复它?
提前致谢, 乔治
I am using SQL Server 2008 Enterprise with VSTS 2008, and I am developing a simple web application using ASP.Net and Forms Authentication.
When I am using the configuration tool/menu of VSTS of my ASP.Net project (I want to use this tool to manually add some Forms authentication users), I met with the following error (SqlException),
Trying to attach file D:\Projects\MyTest\App_Data\aspnetdb.mdf to automatically named database failed. It may be caused by existing the same name database, or may be caused by specified file can not be opened or caused by the specified file exists in UNC share.
In my computer, there is no aspnetdb.mdf under dir D:\Projects\MyTest\App_Data
, and why this dir will be searched? And I have used aspnet_regsql to generate database successfully before I run the configuration tool. Why there is such error? How to fix it?
thanks in advance,
George
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否已使用命名连接设置您的提供商?
您说您使用了 aspnet_regsql,这表明您正在尝试使用 ASP.NET 成员资格提供程序。如果您没有在配置中配置提供程序和连接,那么它将在您站点的 App_Data 目录中查找名为 aspnetdb.mdf 的 SQL Server Express 文件。
Have you set up your provider with a named connection?
You said that you used aspnet_regsql, which suggests that you are attempting to use the ASP.NET Membership Providers. If you don't configure the providers and connections in your config, then it will look for a SQL Server Express file called aspnetdb.mdf in the App_Data directory of your site.