Solved

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

Posted on 2004-04-02
9
352 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.
0
Comment
Question by:knowlton
  • 5
  • 3
9 Comments
 
LVL 5

Author Comment

by:knowlton
ID: 10743416
Here is my current connection string:

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

This works for other apps just fine.
0
 
LVL 5

Accepted Solution

by:
AdrianJMartin earned 250 total points
ID: 10744180
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
 
LVL 5

Author Comment

by:knowlton
ID: 10744190
The services control panel?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 12

Expert Comment

by:dfiala13
ID: 10744201
What's the Logon account being used by the service?
What account do you logon under?
0
 
LVL 5

Author Comment

by:knowlton
ID: 10744220
Administrator  (and admin pw as well)

Isn't this just a logon for the service itself   (not for the database connection later on?)
0
 
LVL 12

Assisted Solution

by:dfiala13
dfiala13 earned 250 total points
ID: 10744276
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
 
LVL 5

Author Comment

by:knowlton
ID: 10744293
Are talking about mixed authentication versus NT Authentication?
0
 
LVL 5

Author Comment

by:knowlton
ID: 10744321
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
 
LVL 12

Expert Comment

by:dfiala13
ID: 10744369
If you are using windows authentication then the windows account the service is running under comes into play.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question