p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

vs_dotnet thread: Web.config Db Connect String


Message #1 by "Richard Buchner" <rbuchner@s...> on Thu, 9 May 2002 22:10:25 -0500
This is a multipart message in MIME format.
--=_alternative 0013054348256BB5_
Content-Type: text/plain; charset="us-ascii"

You can put any config data in web.config within 
<AppSettings></AppSettings> tags. e.g.

<configuration>

<appSettings>
<add key="ConnString" value="Server=127.0.0.1;User Id=sa;Password=;Initial 
Catalog=myDB;"/>
</appSettings> 
.....
</configuration>

Then you can access this info using configuration class. e.g.

System.Configuration.ConfigurationSettings.appSettings.item("ConnString")

HTH,
Irfan






"Richard Buchner" <rbuchner@s...>
05/10/2002 11:10 AM
Please respond to "Vs_dotnet"

 
        To:     "Vs_dotnet" <vs_dotnet@p...>
        cc: 
        Subject:        [vs_dotnet] Web.config Db Connect String


If I put my Data Base connect string in web.config,

How do I refer to it elsewhere in the project,

Like in the SQL Connection on an ASPX page?

Thanks

Richard Buchner
Hyde Park Systems Group, Inc.
Software for Publishers and Associations
Chicago, IL
mailto:rbuchner@h...
www.hpsg.com





This e-mail (and any attachment (s)) is confidential and for use only by
intended recipient (s). Access by others is unauthorised. Its content
should not be relied upon and no liability or responsibility is accepted by
us, without our subsequent written confirmation of its content. If you are
not an intended recipient, please notify us promptly and delete all copies
and note that any disclosure, copying, distribution or any action taken or
omitted to be taken in reliance on the information it contains is
prohibited and may be unlawful. Further information on Guoco Group is
available from http://www.guoco.com



  Return to Index