Problem with Windows Service

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I need to write a windows service that should call a stored procedure in my SQL database every few seconds. In the onstart event I start a new thread to call a method in my app project. This method calls the stored procedure in an infinite loop. But when I install my service and start, my SP is not getting called at all, could someone tell me where I'm doing wrong? Thanks.
 
Hi Nonnie,

The first question I would ask is how are you connecting to the SQL database
when you call your SP - with SQL Server Authentication or Windows
Authentication? If you are using Windows Authentication then your service
needs to be running under the context of a user who has access to the
database that you are trying to run your SP on.

Gary

Nonnie said:
Hi,
I need to write a windows service that should call a stored procedure in
my SQL database every few seconds. In the onstart event I start a new thread
to call a method in my app project. This method calls the stored procedure
in an infinite loop. But when I install my service and start, my SP is not
getting called at all, could someone tell me where I'm doing wrong? Thanks.
 
Back
Top