Question Locked

Service.vb

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have an application that copies the contents of an Excel file to a SQL Table. It works fine. I've tried to make a Service using Visual Studio but it doesn't trigger the code that I have inserted in the Service. What is the proper way of triggering the codes inside a Service?

I've tried to use a Timer and set its interval to 10000 so the Service will copy the content of an Excel file to a SQL Table every 10 seconds but still it doesn't work.

2 replies

by jeffreyalejo

The Timer control will not work in this scenario. Here are the possible solutions I made with regards to this problem:

1. You can create your own Timer in the On-Start Method.

2. You can use the Windows Scheduler to "Start" the Service you have created.

This discussion is closed to new replies.