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. General Programming
  3. Visual Basic
  4. Changing a database location

Changing a database location

Scheduled Pinned Locked Moved Visual Basic
questioncsharpdatabasehelp
4 Posts 2 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.
  • F Offline
    F Offline
    ford86
    wrote on last edited by
    #1

    I'm doing a project in VB.Net 2003 (I don't think the method and code would really change in Vb.Net 2005) and the client wants to be able to change the database location at any place on his computer. In VB.Net 2003, I'm using the data adapters with datasets, along with a connexion, but my problem is how can I connect the controls to the database and manipulate the data if the location is changed? It's all done with a few lines of code only. Should I forget this method and do it all in code, or maybe someone have a better solution for my problem? Thanks!

    D 1 Reply Last reply
    0
    • F ford86

      I'm doing a project in VB.Net 2003 (I don't think the method and code would really change in Vb.Net 2005) and the client wants to be able to change the database location at any place on his computer. In VB.Net 2003, I'm using the data adapters with datasets, along with a connexion, but my problem is how can I connect the controls to the database and manipulate the data if the location is changed? It's all done with a few lines of code only. Should I forget this method and do it all in code, or maybe someone have a better solution for my problem? Thanks!

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You connect to the database using a connection string. You can change that string to look for the database in just about any location you want.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      F 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You connect to the database using a connection string. You can change that string to look for the database in just about any location you want.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        F Offline
        F Offline
        ford86
        wrote on last edited by
        #3

        By changing only the connection string, the datasource of my grids will still be ok? I won't even need to change it? Well, thanks a lot!

        D 1 Reply Last reply
        0
        • F ford86

          By changing only the connection string, the datasource of my grids will still be ok? I won't even need to change it? Well, thanks a lot!

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Yes.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          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