【发布时间】:2010-11-29 08:36:31
【问题描述】:
我使用的是 Visual Studio 2008,MS SQL server 2008 Express
SQL 服务器:zeroonea\SQL2008EXPRESS
我正在创建一个 webproject,在 App_Data 中创建了一个 dbtest.mdf,创建了一些表,使用 aspnet_regsql 在其中创建成员表,一切正常。
我在 web.config 中的连接字符串:
<connectionStrings>
<add name="dbtestConnectionString" connectionString="Data Source=zeroonea\SQL2008EXPRESS;Initial Catalog=dbtest;Persist Security Info=True;User ID=***;Password=***"
providerName="System.Data.SqlClient" />
</connectionStrings>
当我运行 web 应用程序时它仍然有效,代码可以连接到 sql server
但是当我运行网站管理工具时,点击安全选项卡,我抛出一个错误
There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.
The following message may help in diagnosing the problem: Unable to connect to SQL Server database.
有什么建议吗?
【问题讨论】:
-
我发现了问题,我们应该将名称“dbtestConnectionString”更改为“LocalSqlServer”并且它可以工作
标签: asp.net membership