Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2003, 02:19 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default ConfigurationSettings.AppSettings

Hello,

I've fixed a problem that was happening in my application, but am wondering why it is happening. The problem is I can't get a value directly from the app.config file directly, such as:
Code:
dim objConnection as New SQLConnection(ConfigurationSettings.AppSettings("Connection String"))
...
I had to rework it as:
Code:
dim objKey as System.Collections.Specialized.NameValueCollection = ConfigurationSettings.AppSettings
dim objConnection as new SQLConnection(objKey.Get("Connection String"))
I don't know why I can't reference it as "ConfigurationSettings.AppSettings("Connection String")", because I didn't need to do it this way in my ASP.NET application... any ideas? Also, please note that I may not have spelled something correctly in my code samples. I did get it right in the code, but retyped it here.

Thanks,

Brian Mains
__________________
Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
why use <configSections> instead of <appSettings>? jini BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 January 28th, 2007 08:35 PM
AppSettings("ConnectionString") obsolete stevecist ASP.NET 1.0 and 1.1 Basics 1 December 29th, 2006 01:56 AM
how to store path in web.config appsettings sectio gbianchi ASP.NET 2.0 Professional 0 October 18th, 2006 12:37 PM
ConfigurationSettings.AppSettings com library lpm_forum General .NET 1 October 4th, 2004 02:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.