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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. change server name

change server name

Scheduled Pinned Locked Moved Database
databasesysadminquestion
4 Posts 3 Posters 0 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.
  • P Offline
    P Offline
    Paps2
    wrote on last edited by
    #1

    I need to run my program on my client machine. I had developed my program on my machine and created the DB on my machine. Now I need to transfer the db and my EXE file on to another machine The server name on my machine shows Running - \\Rch1 - MSSQLServer But the server name on the second machine Running - \\Krnot - MSSQLServer How do I replace the servername. My code; Public conn As New OleDbConnection("Provider=sqloledb;server=Rch1;Database=Rch;Trusted_Connection=YES;") Tnx

    C 1 Reply Last reply
    0
    • P Paps2

      I need to run my program on my client machine. I had developed my program on my machine and created the DB on my machine. Now I need to transfer the db and my EXE file on to another machine The server name on my machine shows Running - \\Rch1 - MSSQLServer But the server name on the second machine Running - \\Krnot - MSSQLServer How do I replace the servername. My code; Public conn As New OleDbConnection("Provider=sqloledb;server=Rch1;Database=Rch;Trusted_Connection=YES;") Tnx

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      You should always put that kind of information in the app.cofig file. That way it can be changed when the application is moved around. Hardcoding this information into the app is just going to cause problems (as you have seen)


      "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

      P 1 Reply Last reply
      0
      • C Colin Angus Mackay

        You should always put that kind of information in the app.cofig file. That way it can be changed when the application is moved around. Hardcoding this information into the app is just going to cause problems (as you have seen)


        "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871) My: Website | Blog

        P Offline
        P Offline
        Paps2
        wrote on last edited by
        #3

        Pls Could you give me some more info on this. Tnx

        F 1 Reply Last reply
        0
        • P Paps2

          Pls Could you give me some more info on this. Tnx

          F Offline
          F Offline
          Frank Kerrigan
          wrote on last edited by
          #4

          Try google it works a treat http://www.google.co.uk/search?hl=en&q=app.config+in+vb.net+for+sql+connection++strings&meta=[^] Look where you want to go not where you don't want to crash. Bikers Bible

          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