Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional VB 2005 ISBN: 0-7645-7536-8
This is the forum to discuss the Wrox book Professional VB 2005 by Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Rama Ramachandran, Kent Sharkey, Bill Sheldon; ISBN: 9780764575365
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 9th, 2006, 03:56 AM
Registered User
 
Join Date: Oct 2006
Location: Brisbane, Queensland, Australia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 11 Code Examples

The following line in the GetPubsConnection function in the AdoNetFeaturesTest project is being flagged as obsolete.

ConfigurationSettings.AppSettings("dbConnectionStr ing")†††

I have checked the Online Help which indeed advises that:

This method is deprecated and is maintained for backward compatibility. Please use the GetSection method instead

Looking for GetSection in the help returns some code examples on its usage:

' Get a custom section.
Shared Sub GetSection()
    Try

        Dim customSection As CustomSection

        ' Get the current configuration file.
        Dim config _
        As System.Configuration.Configuration = _
        ConfigurationManager.OpenExeConfiguration( _
        ConfigurationUserLevel.None)

        customSection = _
        config.GetSection("CustomSection")
        Console.WriteLine( _
        "Section name: {0}", _
        customSection.SectionInformation.Name)

    Catch err As ConfigurationErrorsException
        Console.WriteLine(err.ToString())
    End Try

End Sub 'GetSection


This code does not seem to work for me, I get the following error - Type 'CustomeSection' is not defined.

Can anyone show how to return the connection string using GetSection?
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is source code for Chapter 11? benethridge BOOK: Professional Java Development with the Spring Framework 1 September 5th, 2006 08:58 PM
Chapter 11 Code Problems vbswshare BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 3 April 9th, 2006 08:39 PM



All times are GMT -4. The time now is 07:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.