How can I move the SQL Server database from local to public web server?

Hello Everyone,

I have developed one Windows support front end application to connect my local SQL Server database and its working fine. Later I want to move my database to public web server to access the data from internet. But my front end application should be remain same. For the connection changes I will update my code to connect well.

Can someone who have a idea please guide me. What I have to do

Thanks in advance,
Jose


Answer this question

How can I move the SQL Server database from local to public web server?

  • Chan Nyein Zaw

    Hi,

    just read your Connectionstrings out of a comfig file. Your app will connect then to the db defined in the config file.

  • Firehead

    Hi

    I couldn't understand what you are explain to me. Can you reply clearly

    Simply telling : I have a frontend application. The backend should be in public web server (ie. SQL Server) The front application will request connection from web server. Once connection is being made securly the application will work. How it is possible Can someone help me

    Regards,
    Jose

  • CChrisBel

    How about if I want to change my ConnectionString inside my application base on the user input In VS 2003, I can change the SqlConnection.ConnectionString. In VS 2005, I can get the ConnectionString from Properties.Settings. How can I change the value inside my application

    Another question is, if use the app.config file method, do I need to rebuild the apps everytime I change the app.config file

    Thanks to anyone who knows the answer and response.

    Eric Law


  • Steve Hahn

    Hi,

    If I understood your question correctly, you want to be able to connect to a database remotely. Currently you are connecting to a local database.

    In order to do this, the ConnectionString which is needed to make a connection to the database needs to be place outside the code in a configuration file. If your frontend application is a web application then this should be placed in the web.config file. If it is a Windows Application then it should be placed in the app.config file.

    Let me explain step by step:
    1. First change the (local) as name of the database to either the IP address of the database or the name of the database.
    2. In the Project select Add new Item and choose Application Configuration. This will add the app.config file.
    3. Now open the app.config file and add as follows:

    < xml version="1.0" encoding="utf-8" >
    <configuration>
     <appSettings>
      <add key="ConnectionString" value="Data Source=Test1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"  />
     </appSettings>
    </configuration>

    4. In the code add a using/imports directive for the namespace System.Configuration.
    5. You can retrieve the value of connectionstring stored in app.config file using :
    ConfigurationSettings.AppSettings["ConnectionString"]

    Regards,
    Vikram

  • How can I move the SQL Server database from local to public web server?