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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:18:29+00:00 2026-06-17T08:18:29+00:00

I am planning to design an application which would fetch data from a common

  • 0

I am planning to design an application which would fetch data from a common database located in different servers.

Ex:

  • Database A in Server SQLSRV001
  • Database A in Server SQLSRV002
  • etc

I have a sql select query which is to be executed in Database A located in different servers.

    select * from Database A where column1='' and column2=''

I wanted to know if it is possible to create a dynamic connection object such that it uses the same select query and takes the several server number as user (or a hard-coded) input. It executes the select query in the database and brings back the result. Then takes the next server number in line as input, fetches the data, etc.. This goes on until all the server numbers are done with.

Any insight on this would be gladly accepted.

  • 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-17T08:18:30+00:00Added an answer on June 17, 2026 at 8:18 am

    yes you can do that indeed…
    Create a new class and make it an object of type SQLConnection or w/e it is.

    It’s purpose should be to create and maintain a connection with a database and perform various tasks (this part is optional, as you can directly pass in the queries).

    Got this from online

    class DBConnect
    {
        private MySqlConnection connection;
        private string server;
        private string database;
        private string uid;
        private string password;
    
        //Constructor
        public DBConnect()
        {
            Initialize();
        }
    
        //Initialize values
        private void Initialize(String[] connectionInfo)
        {
            server = connectionInfo[0];
            database = connectionInfo[1];
            uid = connectionInfo[2];
            password = connectionInfo[3];
            string connectionString;
            connectionString = "SERVER=" + server + ";" + "DATABASE=" + 
            database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
    
            connection = new MySqlConnection(connectionString);
        }
    
        //open connection to database
        private bool OpenConnection()
        {
        }
    
        //Close connection
        private bool CloseConnection()
        {
        }
    
        //Insert statement
        public void Insert()
        {
        }
    
        //Update statement
        public void Update()
        {
        }
    
        //Delete statement
        public void Delete()
        {
        }
    
        //Select statement
        public List <string> [] Select()
        {
        }
    
        //Count statement
        public int Count()
        {
        }
    
        //Backup
        public void Backup()
        {
        }
    
        //Restore
        public void Restore()
        {
        }
    }
    

    So when you have different databases you can go like:

    DBConnect srv001 = new DBConnect({server1,db1,uid1,pw1});
    DBConnect srv002 = new DBConnect({server2,db2,uid2,pw2});
    

    So now you have 2 concurrent connections to 2 different databases

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am planning on developing .NET web application which also will be accessed from
I would like to design a C# application to store emlployees data, I have
I planning on reading profile data from a xml file in JSP. Now i
I was planning to design an application for me to recover deleted file(s) and/or
I am planning an application which will make clusters of short messages/tweets based on
I'm trying to design a simple Cocoa application and I would like to have
I am planning on creating a DB driven site/ Application which needs to also
I'm planning on building an application that simplifies web design. I intent using Lazarus/FreePascal
So far whenever I am planning the design for an application, I always find
I am planning to design a game server. I wish it could take a

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.