Changing a database location
-
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!
-
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!
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 -
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 -
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!
Yes.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007