A Quick One: Pulling Items Out of the Web.config

Posted by: Paul Litwins Blog, on 17 Aug 2006 | View original | Bookmarked: 0 time(s)

Okay, this one is simple but frankly I always forget it because I don't use it that much AND because there are so many similar sounding classes, properties, and methods that it's not obvious. To pull a connectionString out of the web.config by its name, use this syntax: VB:Dim strCnx As String = ConfigurationManager.ConnectionStrings("connectionstring_name").ConnectionString C#:string strCnx = ConfigurationManager.ConnectionStrings["connectionstring_name"].ConnectionString; To pull an appSetting...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: VB.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 859 | Hits: 137

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD