Avatar of SwatiBhaskar
SwatiBhaskar
 asked on

SQL Server 2005 named pipes error when using web services

I'm consuming a web service from within a ASP.NET application. I get the following error when I try to execute a web method from within the application -

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting 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)
   at Documents.GetStatements(String clientId, String accountNumber, String begDate, String endDate)
   --- End of inner exception stack trace ---

Since the web service is an external one (hosted by a third party vendor), I'm unable to view the SQL Server settings, but I'm sure that remote connections are allowed. Is this an issue with the those settings or can I sort this out at client side here itself?

Thanks.
ASP.NETMicrosoft SQL Server 2005

Avatar of undefined
Last Comment
TheMegaLoser

8/22/2022 - Mon
TheMegaLoser

There are two types of remote connections, both TCP/IP and named pipes. By default both are disabled.

Without knowing the SQL Server configuration this is only a guess but could it be that TCP/IP is enabled and named pipes disabled? That's the way we run the servers at least to minimize the active surface areas.

Have you tried changing your connection string to use TCP/IP instead of named pipes?

If you're unsure on how to do it, post the connection string here and I'll help. Do not post the user name or password in the connection string though but replace them with bogus values.
SwatiBhaskar

ASKER
Thank you for your response.

Since I'm consuming a third party web service, the SQL connection string is not exposed to me - I only reference the web service from within my code.

I'm corresponding with the third party vendor in order to get this sorted out - in the meantime, can you share a sample connection string that uses TCP/IP instead of named pipes?

Thanks.
ASKER CERTIFIED SOLUTION
TheMegaLoser

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes