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 9119353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:22:33+00:00 2026-06-17T05:22:33+00:00

I have 3 separate windows service projects that does exact same thing. The only

  • 0

I have 3 separate windows service projects that does exact same thing. The only difference is that each project file has different connection string setting in the app.config.
I am planning to consolidate the service project to make it more manageable. What is the best approach?

Current Scenario:

3 win services > executes every 6 minutes > hits 3 different databases >
collects data > generates XML > sends the XML to the FTP.

Expected Result:

1 win service > executes every 6 minutes > hits 3 different databases >
collects data > generates XML > sends the XML to the FTP.

  • 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-17T05:22:35+00:00Added an answer on June 17, 2026 at 5:22 am

    So they all do the same thing baring the have different connection strings – “easy”.

    Within your config create a new app setting in the config for “schemas” or something the same and have the values separated with a comma eg:

    <configuration>
        <appSettings>
            <add key="schema" value="connection1, connection2, connection3"/>
        </appSettings>
    </configuration>
    

    Then in your ensure you have a key for each one of the connections in the schema app setting key

    <connectionStrings>
        <add name="connection1" connectionString="your_connection_string" providerName="the_providor"/>
        <add name="connection2" connectionString="your_connection_string" providerName="the_providor"/>
        <add name="connection3" connectionString="your_connection_string" providerName="the_providor"/>
    </connectionStrings>
    

    In your OnStart do something as follows – baring in mind a sleep or thread itteration is needed to be put in but you get the idea:

    protected override void OnStart(string[] args)
    {
        string[] schemaList = ConfigurationManager.AppSettings["schema"].Split(",".ToCharArray());
    
        foreach (string schema in schemaList)
        {
            // do your stuff...
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a Windows service that spawns a separate process. This process creates
I have an existing (C# based) windows service that is derived from the Installer
I have developed a Windows service along with a setup project using Visual Studio
We have a remoting singleton server running in a separate windows service (let's call
I have a windows service that starts a host for a WCF service. I
Background I have a Windows service that uses various third-party DLLs to perform work
I'm working on a WiX 3.5 project that installs a Windows service and a
I wrote a windows service (and it runs fine). Now i have a separate
I have developed a .NET UI and windows service which communicate with each other
I have a windows service which runs a separate thread with a function which

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.