'Unable to connect to SQL Server database' Error when using website administration tool

Posted on 2007-07-20
Last Modified: 2008-01-09
I am using ASP.NET 2.0 on windows vista with sql server 2005 and am having problems setting up user/role information using Project / Configuration / Security Tab. The message i get is....

"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. "

I have used aspnet_regsql.exe to setup the required tables in my sql 2005 database. This is the same database used by my web application which runs fine. So why cant configuration connect to the same database?

When i go into the provider tab and select 'use single provider...' option i can see aspnetprovider shown and selected, but when i click the 'test' link i get the message...

"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. "

Sql server is install on the same machine im using for development and is setup for both windows and sql server logon. If you need more information let me know.

Any ideas?

Question by:flashowl
    LVL 12

    Accepted Solution

    Check ASPNET (or other ASP process account you use) has permissions in your SQL.

    Author Comment

    Thanks for your response.

    I cant see an entry for 'ASPNET' in the permissions section of the server properties and cant add one either. I dont know what ASP process account i would be using. Could you elaborate?


    Author Comment

    I found out what the problem was, inserting this line into the connectionstrings section of the web.config file solved it.

    <remove name="LocalSqlServer" />
          <add name="LocalSqlServer" connectionString="Data Source=mysqlservername;Initial Catalog=mydatabasename;Persist Security Info=True;User ID=sa;pwd=mydbpassword" providerName="System.Data.SqlClient"/>

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now