Detect SQL Server Service

  • Thread starter Thread starter Derek Hart
  • Start date Start date
D

Derek Hart

I am running a winforms application as a scheduled task in Windows, but I
want it to wait to make sure the SQL Server Service is running before it
runs the app. Can I detect this in vb.net code?

Derek
 
Make a connection to the SQL Server database and if it is successful
then the SQL Server service must be running. If the connection attempt
fails it most likely isn't running.
 
Back
Top