0

I developed one web service which simply returns some names from sql database. When I compiled this webservice from visual studio web server, the service is working fine and I am able to retrieve the names from sql database. I hosted the service on iis7 on Windows 7. The service is running fine but is unable to get data from the database. Iam getting the following error:

"A connection was successfully established with the server, but then an error occurred during the pre-login handshake.."

When I debugged my service from iis, the error is connection.serverversion throws system.invalidoperationexception... I don have any clue how to solve this. Kindly help me in this regard. I am using sql server 2008.

Vogel612
  • 5,620
  • 5
  • 48
  • 73
codewarrior
  • 193
  • 1
  • 4
  • 18
  • Check this http://stackoverflow.com/questions/3270199/a-connection-was-successfully-established-with-the-server-but-then-an-error-occ – Max Jun 21 '13 at 07:45
  • No..It dint solve my problem....my visual studio is not running when I ran this application from iis. Even i checked the web server service..it did not exist... – codewarrior Jun 21 '13 at 12:54
  • The user of the app pool of iis can access/read the database ? – Max Jun 27 '13 at 08:44

1 Answers1

0

Potential solutions:

1- Run netsh Winsock reset command. Probably it will fix your issue.

Ref: https://serverfault.com/questions/423013/sql-an-error-occurred-during-the-pre-login-handshake/487139#487139

2- Make sure your connectionstring deos NOT include those:

Encrypt=True
Persist Security Info=True

3- Save your changes and restart Visual Studio. Restart your IIS.

4- Start SQL Server Browser in your "Services" (in the control panel).

5 - Make sure there is enough RAM to run the web service.

Eray Balkanli
  • 7,752
  • 11
  • 48
  • 82