0

I'm trying to get ASP.net StoreFront to Connect to SQL Server Express 2005, on Windows Server 2008. I followed This Microsoft Support article without success. Below is the error.

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
AspDotNetStorefront.Global.Application_BeginRequest(Object sender, EventArgs e) +286
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171

On a Linux System if I were experiencing this error I would use the SQL specific connection client to test the connection (e.g. mysql ). Possibly use telnet to test the port, follow up with iptables if that was the problem. I'm not sure how to go about doing the same things on windows. I've authenticated using SQL Server Management Studio Express using the same credentials? I put a question mark because I'm a bit unsure about one part of the datasource (that should be host/server identifier). I don't think telnet would test the port because windows firewall operates on L7 (it checks the application). How can I find out if the problem is my ability to connect to the server? or the configuration that defines how to connect to the server? (note: security is irrelevant to me, this VM is for development purposes only and is behind my laptops firewalls and has no NAT)

3
  • It seems pretty clear to me that you have a network related issue. SQL Server installs with NO network protocols enabled (Named Pipes and TCP). The only protocol that is enabled by default is Shared Memory, which will allow you to connect to the SQL instance from SSMS running on the same host as the SQL Server. Go into SQL Server Configuration Manager and enable Named Pipes and/or TCP, then restart SQL.
    – joeqwerty
    Sep 13, 2013 at 1:40
  • @joeqwerty did that Sep 13, 2013 at 3:29
  • in the article mentioned Sep 13, 2013 at 3:35

1 Answer 1

0

The problem was with my configuration. I ended up troubleshooting it using sqlcmd.exe which allowed me to attempt to connect manually using the parameters I had specified, and they didn't work. A look at its documentation and I realized that localhost was probably insufficient. I needed to include the instance, as mentioned in the documenation -S [protocol:]server[\instance_name][,port]. Adding this to the sqlcmd string and to the xml configuration fixed my connection issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .