Deployment with DB Connection

  • Thread starter Thread starter James Goodman
  • Start date Start date
J

James Goodman

In VB6 I used to set my applications to automatically look for the source DB in the program installation directory. If it wasnt found it was fairly easy to pop a dialog asking the user to specify the path.

I am writing an app at the moment which will require the user to connect to the DB over a network connection. I am not sure of the connection address at present.

I have created my data-bound forms using server explorer to create the relevant objects.

When it comes to compiling the app & distributing it, how will this be handled.
Am I correct in thinking the path is hard-coded & as such will need to be changed?
Is there a simple way of doing this?
Would using a DSN be better given the situation?



--
Cheers,


James Goodman MCSE, MCDBA
http://www.angelfire.com/sports/f1pictures
 
One way to do this would be to put the connection string into the
app.config file, then you can read it out using the
System.Configuration.AppSettingsReader class. The only downside is that it
is in a text file that anyone can read... so you might not want to put
password type information in the connection string.

You can use the Configuration Override File property (deployment page of
the project properties dialog) to manage multiple app.config files so you
have one for dev/testing, and one for release.


---
David Guyer - VBQA Deployment Testing
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "James Goodman" <j a m e (e-mail address removed) k>
Newsgroups: microsoft.public.dotnet.languages.vb
Subject: Deployment with DB Connection
Date: Thu, 8 Jan 2004 18:01:22 +0000 (UTC)
Organization: BT Openworld
Lines: 85
Message-ID: <[email protected]>
NNTP-Posting-Host: host81-128-207-27.in-addr.btopenworld.com
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0008_01C3D611.67856790"
X-Trace: sparta.btinternet.com 1073584882 17290 81.128.207.27 (8 Jan 2004 18:01:22 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Thu, 8 Jan 2004 18:01:22 +0000 (UTC)
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MSMail-Priority: Normal
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.su
l.t-online.de!t-online.de!diablo.theplanet.net!diablo.netcom.net.uk!netcom.n
et.uk!194.72.7.126.MISMATCH!news-peer-test!news-peer0-test!btnet-peer1!btnet
-feed5!btnet!news.btopenworld.com!not-for-mail
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:171139
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

In VB6 I used to set my applications to automatically look for the source
DB in the program installation directory. If it wasnt found it was fairly
easy to pop a dialog asking the user to specify the path.
I am writing an app at the moment which will require the user to connect
to the DB over a network connection. I am not sure of the connection
address at present.
 
Back
Top