Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 could not open a connection to SQL Server

Author  Topic 

tonyKM
Starting Member

1 Post

Posted - 2006-02-20 : 23:01:37
Hi,

One issue has got me stuck while getting to build an application(ASP.NET/SQLSERVER). Whenever I try to connect to SQL Server 2005 (installed on local host) using Visual Web Developer 2005 Databse Explorer, I get the following error message:

"An error has occured while establishing a connection to the server.
when connection to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - could not open a connection to SQL Server)"


NB:
- on SQL Servers' Surface Area Configuration, Remote connections are set to "Local and Remote connnections" and "Using both TCP/IP and named pipes".

ANyone with a solution? pse help

mikewa
Microsoft SQL Server Product Team

84 Posts

Posted - 2006-02-21 : 03:41:03
A few questions to help troubleshoot this:

When you say "Build" do you mean F5 or are you getting this error just when building, eg SHIFT + CTRL + B?
Are you debuging directly to an HTTP site on your localhost or is this app sitting on the file system?
What is the Service Account being used for SQL Expess?
Where is the database located that you are trying to connect to?

Regards,
Mike Wachal
SQL Express

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Go to Top of Page

larissa.wilkinson
Starting Member

1 Post

Posted - 2007-06-11 : 22:44:00
Hi I'm having a similar problem. I have set up the .aspx website as per the instructions from Microsoft Web Developer and have tried to set up a new connection string called SqlServer1 using the datasource Microsoft Sql Server (SqlClient). I have set up another data access control to access my .mdb database (called CIP Database).. When I go to test connection I get the same error. I have got Microsoft SQL Server 2005 Express Edition. The server has started, the TCP/IP settings are enabled. I have set up the Windows Firewall so that it makes an exception for the server as well as added a new rule. I have also tried using /SQLEXPRESS as the Connection string name but have come up with an error 25 saying the database I'm trying to use does not exist. Does anyone have a solution for this? I need to know a solution specific to the software itself. Just another note, I have set up access permissions to allow all users as well as configured IIS correctly to allow users. I cannot access Security settings in WebAdmin.axd however as it does not appear in the inetpub/wwwroot folder. Sorry for the garble but I am tearing my hair out wondering why this isn't working!
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-06-12 : 12:03:08
What's instance name? Which port number the instance is listening on? Do you use valid sql login?
Go to Top of Page
   

- Advertisement -