2009-09-18 139 views
3

我使用Visual Studio 2008,MS SQL Server 2008 Express的网站管理工具:无法连接到SQL Server数据库

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

但是当我运行的Web站点管理工具,点击安全标签,我把一个错误

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. 

任何建议吗?

+0

我发现了这个问题,我们应该将名称“dbtestConnectionString”更改为“LocalSqlServer”并且它可以工作 – complez 2009-10-14 11:37:50

回答

0

您是否将示例中的db登录名和密码替换为***?如果不是,那可能是你的问题。

+1

我不是那么笨的:| – complez 2009-09-18 04:23:57

+0

如果我侮辱了你,我很抱歉,那不是你的意图。但根据你在问题中提供的信息,这是我最好的答案。 – 2009-09-18 04:36:28

相关问题