Use the following Method for handling Services in C#
using System.ServiceProcess;
public static class SQLServer
{
public static void Restart()
{
string strSVCName = "MSSQLSERVER";
ServiceController mySC = new ServiceController(strSVCName);
if (mySC.Status == System.ServiceProcess.ServiceControllerStatus.Stopped)
{
mySC.Refresh();
}
else if (mySC.Status == System.ServiceProcess.ServiceControllerStatus.Running)
{
mySC.Refresh();
}
mySC.Start();
}
}
Hope this helps you.