Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2007-07-20
Medium Priority
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 / Asp.net 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 asp.net 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
  • 2
LVL 12

Accepted Solution

patrikt earned 1500 total points
ID: 19529969
Check ASPNET (or other ASP process account you use) has permissions in your SQL.

Author Comment

ID: 19530153
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

ID: 19530471
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Screencast - Getting to Know the Pipeline
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

810 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