We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

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

Tom Knowlton
Tom Knowlton asked
on
Medium Priority
380 Views
Last Modified: 2010-04-15
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.
Comment
Watch Question

Tom KnowltonWeb developer

Author

Commented:
Here is my current connection string:

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

This works for other apps just fine.
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Tom KnowltonWeb developer

Author

Commented:
The services control panel?

Commented:
What's the Logon account being used by the service?
What account do you logon under?
Tom KnowltonWeb developer

Author

Commented:
Administrator  (and admin pw as well)

Isn't this just a logon for the service itself   (not for the database connection later on?)
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Tom KnowltonWeb developer

Author

Commented:
Are talking about mixed authentication versus NT Authentication?
Tom KnowltonWeb developer

Author

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?

Commented:
If you are using windows authentication then the windows account the service is running under comes into play.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.