c# - Detecting SQL Server reboot -


my c# console app runs on different machine sql server 2014. use ado.net connect it. how can detect if sql server automatically reboots after installing windows updates? on client application use systemevents_sessionending not me.

i read connection resiliency, seems not solve problem.

is there specific ado.net event can capture? creating app on server sending udp not prefered solution, aswell dont want use ping etc.

i'm looking event react on.

e.g. notification services: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlnotificationinfo(v=vs.110).aspx

thanks!

if want see if server down or not can use ping class.

using system.net.networkinformation;  var ping = new ping(); var reply = ping.send("sqlserverip");  if (reply.status == ipstatus.success) {     //server available } else {     //server down } 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -