Thursday, March 22, 2012

error: 40 - Could not open a connection

I am developing a web service that uses a sql data connection.

The sql database is on a server, and the development version of my web service is on my pc.

I can connect/access the data accross my network when I run the service on my PC, but as soon as I put the web service onto the server(with the sql) it displays, the service wont function - error: 40 - could not open a connection....

I presume that sql is configured correctly as I am recieving data back when I request it accross the network. I dont understand why it wont work when I have the service on the server with the sql?

Any help will be appreciated.

Do you mean your web service and SQL server are on the same machine? Can you post your connection string here? On which account your web service is running?|||

Yes they are both on the same server

"Data Source=SV1;Initial Catalog=SiteVisitSQL;Integrated security=sspi"

My web service is running on IUSR_SV1, I have created an account for the database/user in Microsoft SQL Server Management Studio Express

Ive never configured anything like this before so any help is much appreciated.

|||

Thanks for all your help

I solved this by adding a user for NT AUTHORITY\NETWORK SERVICE in SQL Management studio

No comments:

Post a Comment