Sometimes I get the following error while I was doing HttpWebRequest to a WebService. I copied my code below too.
System.Net.WebException: Unable to connect
I had this issue happening often. I found SQL Server Agent
service was not running. Once I started the service manually, it got fixed. Double check if the service is running or not:
services.msc
and hit enterSQL Server Agent
(Instance Name)If SQL Server Agent
is not running, double-click the service to open properties window. Then click on Start
button. Hope it will help someone.