Web Site Administration Tool: Unable to connect to SQL Server database

asp.netmembership

I'm using Visual Studio 2008, MS SQL server 2008 Express

SQL server: zeroonea\SQL2008EXPRESS

i'm create a webproject, made a dbtest.mdf in App_Data, made some tables, use aspnet_regsql to create membership tables in there, everything work fine.

my connection string in 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>

It still work when i run web application, the code can connect to sql server

but when i run Web Site Administration Tool, click on Security tab, i throw a error

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.

Any suggestion?

Best Answer

By default, I don't think SQL Express allows remote connections. You have to turn them on in the Server Networking tool.

http://www.linglom.com/2007/08/31/enable-remote-connection-to-sql-server-2005-express/

Also, as that blog mentions, SQL Express may be configured to only allow "Trusted" connections, and by providing a username and password in your connection string, you're connecting using SQL authentication.

Related Topic