Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-04-02
9
Medium Priority
?
357 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:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 5

Author Comment

by:Tom 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 1000 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:Tom Knowlton
ID: 10744190
The services control panel?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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:Tom 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 1000 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:Tom Knowlton
ID: 10744293
Are talking about mixed authentication versus NT Authentication?
0
 
LVL 5

Author Comment

by:Tom 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

610 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