Windows Service Problem

Hi All,

I have developed an application that uses a number of xml schema's to handle data updates, selects etc. The application runs fine however when I put the same code into a windows service timer event the connection falls over with a "login failed for user DomainName\MachineName". The connection string I am using is the same as in the application so I'm not sure why the DomainName\MachineName is coming up in the login failure message.

Any help much appreciated

Regards
Ross
rossc007Asked:
Who is Participating?
 
TimCotteeHead of Software ServicesCommented:
rossc007,

If you run the services.msc either from a command line or by going into "administrative tools" from the control panel, you can select your service and set the the account details under which the service is run.

Tim
0
 
TimCotteeHead of Software ServicesCommented:
Hi rossc007,

Probably because the service is running under the localsystem account and you are using integrated security. This is a common issue with services, you have to either run the service under a domain account that has the appropriate security permissions or use SQL security rather than integrated security and specify the user name and password within your connection string.

Tim Cottee
0
 
rossc007Author Commented:
Hi Tim,

I've tried the user name and password in my connection string, and as before it ran perfectly from the application, but failed on the service. I dont think it will make any diffence but I would like to try your first suggestion, how do I run the service from a domain account?

Cheers
Ross

0
 
rossc007Author Commented:
Hi Tim,

Thanks for that, seems to have done some good but I'm still getting problems. The Login Failed message has gone but I am now getting a message saying that the system can't find the Stored Procedure I'm looking at, also another error saying invalid field name on a differnet adapter. I'd imagine from the results that the login is along the right track but I'm using my login for the service and I have full access to the DB. I see that some services run as network service, perhaps thats the key.

Regards
Ross
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.