p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 (http://p2p.wrox.com/forumdisplay.php?f=264)
-   -   I get an error when running ManageDepartments.aspx (http://p2p.wrox.com/showthread.php?t=68522)

sstuber May 31st, 2008 09:14 PM

I get an error when running ManageDepartments.aspx
 
I get this error when compiling ManageDepartments.aspx. Any ideas on what could be causing this? Thanks for the help!

Code:

Line 48:        Protected Shared ReadOnly Property Settings() As StoreElement
Line 49:            Get
Line 50:                Return Globals.Settings.Store
Line 51:            End Get
Line 52:        End Property
 

Source File: D:\Documents and Settings\username\My Documents\Visual Studio 2005\WebSites\book\App_Code\BLL\Store\BaseStore.vb    Line: 50

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   MB.TheBeerHouse.BLL.Store.BaseStore.get_Settings() in D:\Documents and Settings\username\My Documents\Visual Studio 2005\WebSites\book\App_Code\BLL\Store\BaseStore.vb:50
   MB.TheBeerHouse.BLL.Store.Department.GetDepartments() in D:\Documents and Settings\username\My Documents\Visual Studio 2005\WebSites\book\App_Code\BLL\Store\Department.vb:104


Lee Dumond May 31st, 2008 10:45 PM

You need to define a StoreElement class in your ConfigSections.cs file.


sstuber June 1st, 2008 12:00 AM

I have already defined the StoreElement class in the ConfigSections file. Just like the book example shows it contains the following ConfigurationProperties:
(connectionStringName, connectionString, ProviderType, RatingLockInterval, PageSize, rssItems, DefaultOrderListInverval, SandboxMode, BusinessEmail, CurrencyCode, LowAvailability, EnableCaching, CacheDuration)


All times are GMT -4. The time now is 05:12 PM.

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