I have written a windows service , S1 , that is scheduled to run daily. It reads some files and updates the database. It works well .
A requirement has arisen to call this service from a report program, as the report needs to see the latest data being updated by this service.
This is the code i am using.
Expand|Select|Wrap|Line Numbers
- ServiceController controller = new ServiceController();
- controller.ServiceName = "S1";
- //controller
- try
- {
- controller.Start();
- }
- catch(Exception e)
- {Response.Write(e.Message + " , " + e.StackTrace);}
I tried configuring service bpth for localsystem and localservice accounts, but both dont work
Please help me,
Thanks and regards
nanda