I have this code:
if ( con.SqlConnection.State == System.Data.ConnectionState.Broken ||
con.SqlConnection.State == System.Data.ConnectionState.Closed
){
con.SqlConnection.Open();
}
I have lost connection to the network. When i come to my if, then my SqlConnection.State still says open.
How do i refresh my state of my SqlConnection
You can always monitor the state of your
SqlConnectionby using the SqlConnection.StateChange Event