Is it possible to detect an error in a connection before we get an application "Transport-level error" using Linq?
Lets say that I have a SQL server called SQLServer1, and I am running an application that connects to that server using LinQ to get some information.
I decide to change the server Name to SQLServer2. The next time my application run I will get an error like this:
"A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)"
Because LinQ doens't know that there was a change!
How can I catch this during runtime? Is it possible to extend the DataContext class to check somehow the connection before getting the data?
Thanks!