Is there anyway to control a service from code? I want to be able to stop a service based on it reading a flag from within a database. It is a multithreaded program. The threads are controlled by a db flag. Is there a way in code to tell the service to stop?