Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America asked on

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.
C#

Avatar of undefined
Last Comment
dfiala13

8/22/2022 - Mon
ASKER
Tom Knowlton

Here is my current connection string:

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

This works for other apps just fine.
ASKER CERTIFIED SOLUTION
AdrianJMartin

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
Tom Knowlton

The services control panel?
dfiala13

What's the Logon account being used by the service?
What account do you logon under?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
ASKER
Tom Knowlton

Administrator  (and admin pw as well)

Isn't this just a logon for the service itself   (not for the database connection later on?)
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
Tom Knowlton

Are talking about mixed authentication versus NT Authentication?
ASKER
Tom Knowlton

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?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
dfiala13

If you are using windows authentication then the windows account the service is running under comes into play.