🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database.dotnet
Article #596

Re: connectionstring, databasename

#596
From: Stuart Jones
Date: Tue, 02 Nov 2004 05:39
50 lines
2191 bytes
"L.M. Bemmelmans" <info@diractivity.nl> wrote in message
news:4186306a$1@newsgroups.borland.com...
> Hi,
>
> During development my connectionstring has the following databasename:
>
> "c:\inetpub\wwwroot\myApplication\bin\mydatabase.mdb"
>
> On my website the database should be in the "www\bin" directory
>
> What should the name of de database then be ? "www\bin\mydatabase.mdb", or
> "bin\mydatabase.mdb" ?
> How can I place/retrieve this connection-information in the config file ?
>
> Leon
>
>

Hi Leon,
here is a sample which was provided to me by John Moshakis in these
newsgroups.
I hope it can hope you as well.

regards
Stuart

In the Web.Config file add something like the following.

 <!--  APPSETTINGS
    This section sets the database connection properties.
 -->
  <appSettings>
 <add key="BLA.ConnectionString"
value="database=DB;uid=username;server=Delphi-DotNet;pwd=password" />
  </appSettings>

in your code perhaps add something like this.

function DA.CreateDBConnection():SQLConnection;
var
  Connection: SQLConnection;

begin
  Connection := SQLConnection.Create;
  Connection.ConnectionString :=
ConfigurationSettings.AppSettings['BLA.ConnectionString'];

  result := Connection;
end;
Technical Details
Message-ID: <41871c32@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.moat.net!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4186306a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1effe6,995640df0558e5ba
X-Google-Attributes: gid1effe6,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Stuart Jones" <stuartj_at_cmshosp.com.au>
From: "Stuart Jones" <stuartj_at_cmshosp.com.au>
Newsgroups: borland.public.delphi.database.dotnet
References: <4186306a$1@newsgroups.borland.com>
Subject: Re: connectionstring, databasename
Date: Tue, 2 Nov 2004 16:39:18 +1100
Lines: 52
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 210.193.145.147
Message-ID: <41871c32@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1099373618 210.193.145.147 (1 Nov 2004 21:33:38 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.moat.net!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail