I've come across a very odd problem that I can't get my head around. I've written a web service that uses some third party dlls to query a SQL 2000 server (the ddls are for SIMS by Capita if this helps anyone, but have no access to the code so I'm not quite sure how this is done).
The code runs fine under IIS, runs fine under a Cassini application I've written, but errors under a Cassini service I wrote. The service I wrote was very basic and quickly written so I thought I'd try under are more developed version so I tried UltiDev and the error persists. This is under the .NET 2.0 version.
The error I am getting is:
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 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
I can supply the rest of the error message if required.
I've tried running the service under a user account rather than the system account with no joy. The problem is unlikely to be on the SQL server as the error is just a default error and it works under Cassini running as an application.
Just to add an extra little twist, the some of the calls access COM objects and others .NET dlls. The COM object calls work fine, it is just the .NET dll calls that error.
If anyone could shed some light onto this I'd be very grateful, I've been tearing my hair out for the last few days.
Cheers
Chris