Skip to main content

How to connect to remote SQL Server Database

How to connect to remote SQL Server Database ?

           To most website are dynamic. We store our data in database for security and for easy maintenance. Here the basic step to connect remote sql server database.
  1. SQL Server Management studio.
  2. Connect to database 
  3. Give Remote Server Name mostly Ip address is given, then type user name and password and click connect as shown figure.
    remote SQL Server Database
  4. Choose the Database you want to connect from list as shown below.
    remote SQL Server Database
  5. Right on Database and Click Properties, The properties window appear
  6. From the properties window choose the connection tab.
    remote SQL Server Database
  7. Now Edit your Web.config file Microsoft Visual studio. 
  8. Move ConnectionString tag in Web.config, in add tag paste the connection properties ie previously copied in step 6. Show in image below

    remote SQL Server Database
  9. Now  give name for connection string in web.config file under ConnectionString tag 
    remote SQL Server Database
  10. In code behind page in Microsoft Visual studio we add connection string name as image shown below. 
    remote SQL Server Database
  11. We can use connection string for every other connection.

     

Comments