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?

[Webinar] Streamline your web hosting managementRegister Today

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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
All Courses

From novice to tech pro — start learning today.