我使用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.
任何建議嗎?
我發現了這個問題,我們應該將名稱「dbtestConnectionString」更改爲「LocalSqlServer」並且它可以工作 – complez 2009-10-14 11:37:50