Solved

How to change the connectionstring during setup in VB.NET

Posted on 2004-03-24
2
409 Views
Last Modified: 2006-11-17
I am using an oleDbConnection to connect to a MS Access file (mydata.mdb) that uses Connectionstring ....Datasource="c:\data\mydata.mdb"...
I want to give the users ability to change this filepath during setup.
A filedialog box (or something) to browse to a fileshare for example g:\data and then the setup will install/copy the mydata.mdb to g:\data,
and change the datasource path to the same selected fileshare.

I have tested the Application Configuration File withe the following xlm code:
<?xml version="1.0" encoding="Windows-1252"?>
<configuration>
  <appSettings>
    <add key="datasource" value="g:\data" />
      </appSettings>
</configuration>

Example of different installation cenarios:
One company will maybe use a local installation and the datasource value would be "c:\data" (default)
The next company will maybe use a client/server model and the datasource value should point to a datashare ("x:\common")
The next company will maybe use a client/server model and the datasource value should point to a datashare ("f:\dep_data")
and so on...

I want the user/company to select where to put the mydata.mdb during setup ( OR at first application startup )
(Not manually change the configuration file).
0
Comment
Question by:Bengtb
  • 2
2 Comments
 
LVL 28

Accepted Solution

by:
mmarinov earned 500 total points
ID: 10667641
0
 
LVL 28

Expert Comment

by:mmarinov
ID: 10676943
hi Bengtb,

what is wrong with the solution from the given link? Why grade C?

B..G
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question