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

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -