I understand how to check to see if a database exists on a SQL server on my local machine by using DbContext.Database.Exists()
, but how do I check to see if the server is up and running?
I see a topic under "questions that may already have your answer" that recommends checking into the ServiceController
class How can I verify if a Windows Service is running However, Visual Studio Intellisense does not detect System.ServiceProcess Namespace when I type it into my class.
Also, if the ServiceController class is the best answer to this question, how do i Identify to the ServiceController class what service it is that needs to be assigned to this object?