Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 January 21st, 2008, 12:30 AM
Authorized User
 
Join Date: Jul 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default ConfigSection

Following is the code located in the /App_Code/ConfigSection.cs file

      [ConfigurationProperty("defaultConnectionStringName ",
         DefaultValue = "LocalSqlServer")]
      public string DefaultConnectionStringName
      {
         get { return (string)base["defaultConnectionStringName"]; }
         set { base["connectionStdefaultConnectionStringNameringNa me"] = value; }
      }

In this code
the get method is using the ID defaultConnectionStringName
but
the set method is using the Id connectionStdefaultConnectionStringNameringName

I am not understanding why this sets the value in some variable and calls from other variable.

 
Old January 21st, 2008, 06:53 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

hi there,

it's actually a typo and should read:

      [ConfigurationProperty("defaultConnectionStringName ",
         DefaultValue = "LocalSqlServer")]
      public string DefaultConnectionStringName
      {
         get { return (string)base["defaultConnectionStringName"]; }
         set { base["defaultConnectionStringName"] = value; }
      }

the issue would only come to light, if you wanted to override the default entry as detailed in the web.config file.

to be honest, i'd never noticed this error before :)

jimi

http://www.originaltalent.com
 
Old January 21st, 2008, 02:29 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Yes, that is a typo error. I believe this typo actually appears twice in the chapter, so be on the lookout for it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
in web.config or ConfigSection.cs? jini BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 February 3rd, 2007 04:39 AM
ConfigSection Error - CS0029: Cannot implicitly co bigluzer BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 January 9th, 2007 12:37 AM
configSection.cs and other bafflements MM BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 November 16th, 2006 06:45 PM





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