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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:58:57+00:00 2026-05-12T05:58:57+00:00

I have been working in a business writing advanced software apps, and obviously im

  • 0

I have been working in a business writing advanced software apps, and obviously im provided with access to our SQL server and all the connection strings needed.This is fine for my job now – but what if i wanted to do this for a new (very small) business… If i wanted to purchase a small database server and set up a piece of software that talks to the databases on this server, how would i go about a) Talking and connecting to the server in code (c#) and b)What would i need regarding things like internet/phone connections etc to make this possible.

Edit: the reason it would need a server is because it would need to be accessed from 2 or 3 different computers in different locations?

  • 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-05-12T05:58:58+00:00Added an answer on May 12, 2026 at 5:58 am

    Actually there are quite a few ways to create a database connection, but I would say one of the easiest ways is to utilize the methods and classes found in System.Data.SQLClient. A basic connection would look something like the following:

    using System.Data.SQLClient;
    
    namespace YourNamespace
    {
        public class DatabaseConnect
        {
             public DataType getData()
             {
                DataType dataObj = new DataType();
    
                SqlConnection testConn = new SqlConnection("connection string here");
                SqlCommand testCommand = new SqlCommand("select * from dataTable", testConn);
                testConn.Open()
                 using (SqlDataReader reader = testCommand.ExecuteReader())
                {
                    while (reader.Read())
                    {
                       //Get data from reader and set into DataType object
                    }
                }
    
                return dataObj;
             }
        }
    }
    

    Keep in mind, this is a very, very simple version of a connection for reading data, but it should give you an idea of what you need to do. Make sure to use a “using” or “try/catch” statement to ensure that the connection is closed and resources are freed after each use (whether it successfully gets data or not).

    As for your other question about what equipment you may require. In the beginning I would suggest just creating the database on your local machine and running tests from there. Once you are confident with trading data back and forth, feel free to move the database to another box or an online server. Any internet connection type should suffice, though I can’t vouch for dial-up, haven’t used it in years.

    One final note, if you do happen to decide to move to an online server system, make sure that the service you use allows for outside connections. Certain services use shared server systems, and force users to use their internal database interfaces to manage and write to the database.

    — EDIT —

    As for the server system itself, build up a separate box on your local network that you can see, and load up the database software of your choice. Since you are using C#, it would probably be easiest to go with Microsoft SQL Server 2005 / 2008. The installation is rather straightforward, and it will prompt you to automatically create your first database while installing.

    After installation it will be up to you to add in the tables, stored procedures, custom functions, etc… Once your base structure is created, go ahead and use the above code to make some simple connections. Since you are familiar with the above practices then I’m sure you know that all you really need to do is target the server machine and database in the connection string to be on your way.

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

Sidebar

Related Questions

I have been working on a WCF service library where hopefully all the business
I have been tasked with creating a Software Installation Approval section for our Intranet.
We have a legacy VB6 app, which is critical to our business. We're working
I’ve been working on a few small scale Access projects that have turned large
Have been working on this question for a couple hours and have come close
I have been working on Eclipse recently. I am fairly new to java programming,
I have been working on a Windows Mobile app for a little while now
I have been working on keeping things object oriented for my project. Currently, I'm
I have been working on this problem for 2 days now and it's an
I have been working on a django app on my local computer for some

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.