Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Is connection string must be changed after deployment ???

Is connection string must be changed after deployment ???

Scheduled Pinned Locked Moved ASP.NET
databasequestionsql-servercomsysadmin
6 Posts 4 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kindman_nb
    wrote on last edited by
    #1

    Hi my friends , my database is sql and it's work as good on local mode , but after copy web site , an error with web.config ,, sure it's is the connection string , I ask if I must change the connection string or not ,,, when I take a domain on details I see : MSSQL mssql136.win-servers.com what is the new connection string to be right ..

    jooooo

    C A T 3 Replies Last reply
    0
    • K kindman_nb

      Hi my friends , my database is sql and it's work as good on local mode , but after copy web site , an error with web.config ,, sure it's is the connection string , I ask if I must change the connection string or not ,,, when I take a domain on details I see : MSSQL mssql136.win-servers.com what is the new connection string to be right ..

      jooooo

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      It depends. If your old SQL Server is on your local network, and your web server cannot see it, then you need to deploy to a SQL Server that the web server can see. If the server is on your network, and the SQL Server was not the local machine, it should just work.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      K 1 Reply Last reply
      0
      • C Christian Graus

        It depends. If your old SQL Server is on your local network, and your web server cannot see it, then you need to deploy to a SQL Server that the web server can see. If the server is on your network, and the SQL Server was not the local machine, it should just work.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        K Offline
        K Offline
        kindman_nb
        wrote on last edited by
        #3

        Thanks my friend ,, I will check it

        jooooo

        1 Reply Last reply
        0
        • K kindman_nb

          Hi my friends , my database is sql and it's work as good on local mode , but after copy web site , an error with web.config ,, sure it's is the connection string , I ask if I must change the connection string or not ,,, when I take a domain on details I see : MSSQL mssql136.win-servers.com what is the new connection string to be right ..

          jooooo

          A Offline
          A Offline
          Ashish Sehajpal
          wrote on last edited by
          #4

          you need to specify the IP adress/ live URl of database server (even the port number if it is on shared hosting)

          Ashish Sehajpal

          1 Reply Last reply
          0
          • K kindman_nb

            Hi my friends , my database is sql and it's work as good on local mode , but after copy web site , an error with web.config ,, sure it's is the connection string , I ask if I must change the connection string or not ,,, when I take a domain on details I see : MSSQL mssql136.win-servers.com what is the new connection string to be right ..

            jooooo

            T Offline
            T Offline
            Tom Harper
            wrote on last edited by
            #5

            I have a trick for this situation I keep three connection strings in my web.config file. The first connection string is named app_name_local, the second is app_name_server and finally app_name_application. For example if you have an application Foo you would have Foo_local, Foo_server, and Foo_application. I make all connections in the application to the app_name_application string. This makes it simple to manage. You never have to make a change to the connection string name anywhere in the application. I also keep copies of the server string and the local string in the other connection strings. When I upload the web.config file to the server, the only change I need to make is to the application connection string by copying the string from the server cs to the application cs. This way, I can keep local data to code with and not affect real data on the server. I hope this helps. Tom

            K 1 Reply Last reply
            0
            • T Tom Harper

              I have a trick for this situation I keep three connection strings in my web.config file. The first connection string is named app_name_local, the second is app_name_server and finally app_name_application. For example if you have an application Foo you would have Foo_local, Foo_server, and Foo_application. I make all connections in the application to the app_name_application string. This makes it simple to manage. You never have to make a change to the connection string name anywhere in the application. I also keep copies of the server string and the local string in the other connection strings. When I upload the web.config file to the server, the only change I need to make is to the application connection string by copying the string from the server cs to the application cs. This way, I can keep local data to code with and not affect real data on the server. I hope this helps. Tom

              K Offline
              K Offline
              kindman_nb
              wrote on last edited by
              #6

              thanks my friend ....

              jooooo

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups