I have my own application server which is windows service who communicates with the sql server, in some cases sql server service is stop so I am stating that via this code
ServiceController sc = new ServiceController("MSSQL$SQLEXPRESS");
sc.Start();
sc.WaitForStatus(ServiceControllerStatus.Running);
but it requires administrator privileges to start service how can I start my window service as administrator
i just add this tag in my app.manifest file
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
it works ...