Skip to content

Server path

vikas kanani

Asked Sep 21, 2012, 8:38 PM EDT3 answers
Share
LinkedInX
suppose my project is completed.now project application transfer to the many pcs.sql database is save in my pc.if exe file transfer to other pcs.then any possibilies they can access database.please its urgent how to do it.

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Akkiraju Ivaturi
    0
    If all PCs are connected in a network, then the database can be accessed by all the applications even if the database is in your system. Basically all the systems with in intranet can communicate with each other and so there will be no issues.

    If you want to expose data outside the firewall i.e., through internet then you need to develop services to deal with request and response from database. I suppose in your scenario, you only need to use correct connection string to connect to database and it works with no extra efforts.

    Let me know if you have any specific questions.
    0
  • 0
    yea..u got my que..yea pcs r connecetd in network.so how can all of them access my database from my server...help me.
    0
  • Akkiraju Ivaturi
    0
     string connetionString = null;
                SqlConnection cnn ;
    connetionString = "Data Source=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password" 
                cnn = new SqlConnection(connetionString);
                try
                {
                    cnn.Open();
                    //do whatever is needed
                    cnn.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Can not open connection ! ");
                }

    Specify your server name for Datasource and that is enough. If you want to know the name of server open sql server instance in your computer and check what is the name it is showing at the root node on the left where all the databases are displayed.

    First test the connection from your system and if it works the same would work as the computer is in network. Try and let me know if you face any issues.
    0