Last post Nov 15, 2019 02:35 AM by Yang Shen
Nov 14, 2019 08:54 AM|santosh-hegde|LINK
Nov 14, 2019 11:53 AM|PatriceSc|LINK
Do they have the same firewall configuration and/or both servers are authorized on the db side firewall if any ?
"An existing connection was forcibly closed by the remote host" means basically the network request is sent but later blocked explicitely while en route to the target server, most often because of a firewall config.
Nov 15, 2019 02:35 AM|Yang Shen|LINK
"An existing connection was forcibly closed by the remote host "
As @PatriceSc mentioned, this issue can usually caused by the firewall configuration, please make sure the firewall configuration of your servers are the same.
However, i think it is also possible that the error is caused by your project configuration since it is related to System.Data.SqlClient.
First, i recommend you could debug your program and locate which line caused the error.
Second, you can check your c# code since we can't see you close the connection by
con.Close() after you did con.Open() or maybe you just didn't provide the complete code. Use a
using statement will be even better.
Also, i found a similar case at What is the cause of this error? you met really similar situation that maybe you can check it for answer since there's a MVP telling how
to figure out the question where you can follow. At the end of that thread, op solved his problem by adding MultipleActiveResultSets=true to his webconfig's connectionstring.
Last but not least, you really should modify your post since it's really hard to read which makes the community harder to help.