none
Detect SQL Server remote TCP connection Lost RRS feed

  • Question

  • Hi,

    Please, is there any way to detect when a SQL SERVER TCP connection is lost between Client and Server ?

    In other, is there any event on Entity Framework on in DotNetFramwork with classic connection to detect when the Client lost the connection with Database Server ?

    As the first revelation is to create Socket TCP Server on the Server and Check it in my client app. 

    I need to know when connection is lost to relunch registering to the SQLDependecies.

    Please what you suggest ?

    Thanks,

    Wednesday, July 11, 2018 5:05 PM

All replies

  • Hi,

    Please, is there any way to detect when a SQL SERVER TCP connection is lost between Client and Server ?

    In other, is there any event on Entity Framework on in DotNetFramwork with classic connection to detect when the Client lost the connection with Database Server ?

    As the first revelation is to create Socket TCP Server on the Server and Check it in my client app. 

    I need to know when connection is lost to relunch registering to the SQLDependecies.

    Please what you suggest ?

    Thanks,


    When a program comes back with the exception message "Network Error 26 and no instance of MS SQL Server could be found", then you'll know something has happened.
    Wednesday, July 11, 2018 5:47 PM
  • Have you checked if SqlDependency.OnChange is received in such circumstances?


    Thursday, July 12, 2018 5:18 AM