Windows Service using ASP .NET

  • Thread starter Thread starter Stephen
  • Start date Start date
S

Stephen

Hi,
I created a windows service to insert data into a DB,
First time I tired to insert data on_start() it starts perfectly but the
insert is for a single entry into the DB
checked Services and it highlights the stop button

Now I wanted it add data continously so i put a while loop and to exit if it
errors, i deployed and click "start" on services, this time it took a long
time to do start the service but the status was still "Starting" instead of
"started"
Data entry into the DB was normal, no error logs, created a new entry in
"eventvwr.msc"

the Problem: I cannot stop the service, I cant kill it.... what am I doing
wrong?

Please advice,
Stephen
 
For starters why would you want to insert data when you start the
service? The start even is made to initialize data and make the
service ready to operate. An example of something you would do on the
start event is open a TCP\IP connection so you can receive connections
from clients (if you were doing making a server).

The reason your service is saying "starting" is because the status
doesn't change until after your start event is completed and because
you are continuously adding and the service never notifies the SCM that
everything started ok.

What exactly are you trying to do? Are you trying to have ASP.NET
notify the windows service when to insert data?
 
Hi,

Thanks for the Info. I am still experimenting and for starters I thought I
will just insert data while the service is running and delete e'thing when
the service is stopped. I had never worked with Windows Service and will get
a project on similar lines.

For starters the project will be like this:
Move data from one or more DB's into another DB (via an engine) which has to
run continously even during Log off and a webpage will read from the new DB
and display information, So i thought windows service might be a good
choice. If you have another way of doing this, please do let me know.

Thanks,
Stephen
 
Back
Top