Web Site Administration Tool – Unable to connection to SQL Server database

November 24, 2009

I was configuring a site for ASP.Net membership today, I got as far populating the database with the various tables (Using aspnet_regsql.exe), and then added the web.config elements – The connection string and membership provider.

All seemed well and good. I ran the web site configuration tool (Website > Asp.Net configuration from Visual Studio 2008). I then clicked ‘Create or Manage Roles’. I got the following error message:

Unable to connect to SQL Server database

Why? By default, Asp.Net membership connects to a local SQL Express database for its roles, users, profiles etc, under a connection string name of ‘LocalSqlServer’. So, what we need to do is:

a) Remove the connection string from memory

b) Replace it, with one of the same name but with a connection string that talks to our database

Fortunatley, this is easily done within web.config as follows:

<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString=" ...  Your connection string here ... "/>
Advertisements

One Response to “Web Site Administration Tool – Unable to connection to SQL Server database”

  1. Randy said

    Thank you so much for applying some time in order to write “Web Site Administration Tool – Unable to connection
    to SQL Server database Natural Progression”. Thanks yet again ,Anton

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: