Windows Service trying to write to database table...proglem logging in

I am getting the following SQLException:

      Message      "Login failed for user 'ITDEV\Administrator'."      string


~~~~~~~~~~~~~~

Now, I know that I can use SQL Server Enterprise Manager just fine.....and I can read and write to the table that I am trying to write to in my C# Windows Service.  I know that other parts of the Windows Service are running okay.
LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
AdrianJMartinConnect With a Mentor Commented:
Possible:
The windows service is running under the wrong account, i thin the default is 'local service', as a test,  in the services control panel change the log on account for your service to your ITDEV\administrator one, and see if it works.

0
 
Tom KnowltonWeb developerAuthor Commented:
Here is my current connection string:

server=ITDEV;Trusted_Connection=yes;database=RedWall;

This works for other apps just fine.
0
 
Tom KnowltonWeb developerAuthor Commented:
The services control panel?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
dfiala13Commented:
What's the Logon account being used by the service?
What account do you logon under?
0
 
Tom KnowltonWeb developerAuthor Commented:
Administrator  (and admin pw as well)

Isn't this just a logon for the service itself   (not for the database connection later on?)
0
 
dfiala13Connect With a Mentor Commented:
Depends on whether or not you are using mixed authetication for SQL Server or not.

If you are not, you need to supply ther SQL user ID and password the service will use to login in the connection string
0
 
Tom KnowltonWeb developerAuthor Commented:
Are talking about mixed authentication versus NT Authentication?
0
 
Tom KnowltonWeb developerAuthor Commented:
I am positive I use Windows NT authentication when creating a DSN  under   Data Sources (ODBC) in Administrative Tools.  These DSN entries are on the same machine I am testing the Windows Service on.

Does this help?
0
 
dfiala13Commented:
If you are using windows authentication then the windows account the service is running under comes into play.
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.