What if database server is down/under maintenance or a lost connection in network?

Nov 22, 2016 at 10:41 AM
I use SqlTableDependency as a windows service C#

Question
What if database server is down/under maintenance or a lost connection in network?
Can it resumes itself?


Here is part of my code:
    private void dependency_OnError(object sender, TableDependency.EventArgs.ErrorEventArgs e)
    {
        log.Error(e.Error);
    }

    protected override void OnStop()
    {
        dependency.Stop();
        log.Info("MonitorAlarm onStop.");
        eventLog1.WriteEntry("MonitorAlarm onStop.");
    }