Solved

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

Posted on 2004-04-02
9
350 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Achieve json result 2 65
In C#, how would you convert a byte array to its integer value equivalent? 12 38
Connecting database in Xamarin? 6 50
Allow space in this pattern 2 47
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now