473,385 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Not able to start a windows service from a program

Hello,

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
  1.         ServiceController controller  = new ServiceController();
  2.             controller.ServiceName = "S1";
  3.  
  4.             //controller
  5.             try
  6.             {
  7.                 controller.Start();
  8.             }
  9.             catch(Exception e)
  10.         {Response.Write(e.Message + " , " + e.StackTrace);}
  11.  
The error is get is cannot start service S1 from machine "."

I tried configuring service bpth for localsystem and localservice accounts, but both dont work


Please help me,

Thanks and regards
nanda
Mar 4 '08 #1
2 841
Plater
7,872 Expert 4TB
Can you go to to the services window and click start?
Or start it from the command line with "NET START <servicename>"?
Mar 4 '08 #2
MedIt
15
It is worth checking if you are using the correct service name, and as sometimes the service name and the display are different.
May 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: GTi | last post by:
I have small program that always must be running when a user is logged on. Since users can close this program I must create a program that always check if this program is running. So I created a...
5
by: SiD` | last post by:
when starting a windows service writte in vb.net, a messagebox appears: cannot start service from the command line or a debugger. A windows service must first be installed using installutil.exe ...
17
by: UJ | last post by:
Is there any way for a windows service to start a windows program ? I have a service that will need to restart a windows app if it needs to. TIA - Jeff.
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.