I have created a Windows service, which runs perfectly. I have also set up an installer. However, when I try to run this service on my local machine, it doesn't work, and it doesn't make any changes to my sql server database .
Loading
I have created a Windows service, which runs perfectly. I have also set up an installer. However, when I try to run this service on my local machine, it doesn't work, and it doesn't make any changes to my sql server database .
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sarthak VarshneyPosted Oct 30, 2023, 10:32 AM
To give your local service permission to access your SQL Server database, you can follow these steps:
This will return the SID of your local service account.
Be sure to replace
database_namewith the name of your SQL Server database.Restart your SQL Server service. This will ensure that the changes you made take effect.
Restart your local service.
Once you have completed these steps, your local service should be able to access your SQL Server database.
Here is an example of how to grant the local service account the necessary permissions on a SQL Server database using SSMS:
Once you have granted the local service account the necessary permissions, you should be able to start your local service and it should be able to access your SQL Server database.
Aymen AmriPosted Oct 23, 2023, 12:04 PM
Hello Ishika
Maybe you could check following points :
I would recommend that you trace the execution of the service into a log file in order to have more details about the issue.
You can also run the installed service then debug your code from VS using the Debug ==> Attach to process