0

I try to use Web Site Administration Tool to set up Roles in my website.

I receive an error testing "AspNetSqlProvider"

"Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider."

I used aspnet_regsql command-line utility successfully and in Visual Studio I can see in Server Explorer the database and all the tables.

WebConf is empty

What the problem could be? thanks

GibboK
  • 71,848
  • 143
  • 435
  • 658

2 Answers2

1

I've hade the same problem as you before. If you check your web.config you need something like this:

<connectionStrings>
  <remove name="LocalSqlServer"/>
  <add name="LocalSqlServer"
  connectionString='YOUR CONNECTIONSTRING HERE'
  providerName="System.Data.SqlClient"/>
</connectionStrings>

The important part was the remove LocalSqlServer and that the new connectionString was named the same. Hope this helps.

Teletha
  • 603
  • 1
  • 11
  • 21
0

If you have correctly set up the web.config and still get this error I almost guarantee it is because you have an open connection to it in visual studio which blocks the connection.

Solution:

In visual studio right click the connection to the database (which probably has a 'connected' icon) and click 'close connection'

Reattempt to access the membership administration tool.

et voila

Paul Sullivan
  • 2,865
  • 2
  • 19
  • 25