Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8970285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:42:31+00:00 2026-06-15T17:42:31+00:00

I have developed a Windows Service which stores and retrieves its MSSQL connection string

  • 0

I have developed a Windows Service which stores and retrieves its MSSQL connection string in the registry. However I am experiencing that when my service attempts to connect with the string retrieved from the registry it blatantly ignores the UID and PWD specified.

I then compiled and ran the application as a console application and naturally that worked, since the console application was run with the rights of my own user account, whereas the service was run with the Local System account. The service connected successfully to the database when I specified that the service should be run as my own user account.

My conclusion is that when retrieved from the registry an application for some reason does one or both of the following:

  • Ignores the UID and PWD specified.
  • Automatically assume that the connection should be made in Trusted mode (Trusted_Connection=true)

It is worth mentioning that I have indeed specified Trusted_Connection=false in the connection string stored in the registry.

This is my connection string:

SERVER=.\SQLEXPRESS;DATABASE=mydb;UID=myid;PWD=mypwd

Is anyone able to shed some light on this matter? I would very much like to be able to utilize the user id and password stored in my connection string.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:42:32+00:00Added an answer on June 15, 2026 at 5:42 pm

    I take it you have SQL Server Authentication switched on?

    With integrated authentication (recommended) you need to use change the service Run-As account to an account which has a SQL Server login.

    I.e.

    • Turn ON Trusted_connection. Just … don’t turn it off.
    • Create a user DOMAIN\USR_MYSERVICE.
    • Grant the appropriate machine and database permissions to the account.
    • Set the service to run as that account.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple windows Service that is developed in vb.net 2008. When
I have developed a .NET Windows Service (in VS2010) that needs to: Access shared
suppose i have a windows service which does some work and developed by c#.
I have developed a windows service which reads data from a database, the database
I have developed a .NET UI and windows service which communicate with each other
I have developed one windows service through which I am trying to open an
I have developed a Windows service using Visual Studio 2008. I want to install
I have a simple windows Service developed in VS.net 2008 and VB.net. When I
I have a .net Windows Service developed in VB.net. I have a settings file
I have a windows service that loads multiple handlers written by different developers. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.