Click here to Skip to main content
15,913,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have developed the windows service . there are 3 dependency service into this service like SQL express ,SQL browser , MYSQL.

first time have installed the SQL then the SQL browser disabled no started then i have started the my service then it throws exception "service could not started" .how to start the disabled dependency service when starting the my service?
Posted
Updated 19-Aug-11 23:26pm
v2

1 solution

C#
ServiceController service = new ServiceController(@"Name of service");
service.Start();
service.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(1.0));
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900