views:

1028

answers:

3

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?

A: 

Did you replace the db login and password with *** for the sample? If not, that's probably your problem.

Jakob Gade
i'm not stupid like that :|
complez
I'm sorry if I insulted you, that weren’t the intention. But based on the information you gave in the question, this was my best answer.
Jakob Gade
A: 

Is this any use?

http://weblogs.asp.net/lhunt/archive/2005/09/26/425966.aspx

The fact it's SQLExpress may be adding an extra complication here.

CodeByMoonlight
+1  A: 

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.

rwmnau