Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to change the connectionstring during setup in VB.NET

Posted on 2004-03-24
2
408 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
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…

808 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