Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 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 August 2nd, 2012, 05:47 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Location: Dalls, TX
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 4: ForEach Error b/c ENTBaseEOList does not contain GetEnumerator

I am implemeting this soulution using Visual Studio 2010 and SQL Express. For the most part I have been able to get through Chap 4 (page 88) except for the use of the 'ForEach' statement when referencing the ENTMenuItemBOList reference.
eg.
foreach (ENTMenuItemBO mi in MenuItems)

I am getting a compile error that the ENTMenuItemBOList does not contain a public declaration for 'GetEnumeration'.

This is happening for the 'foreach' statement in the MenuTabs.cs and the ENTMenuItemBO.cs file.

Did I miss some code somewhere or is there something different between VS 2008 and VS 2010?
  #2 (permalink)  
Old September 26th, 2012, 12:28 PM
Registered User
Points: 27, Level: 1
Points: 27, Level: 1 Points: 27, Level: 1 Points: 27, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2012
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Default

On the assumption that you have not made any changes to the original code that would cause this error, the first thing I would check is to see if the menu options are even there. There is an actual check in the code (MenuTabs.cs approx line 43 where it says "if(MenuItems != null)" If MenuItems has not been populated then this should be null and the message "Top Menu Goes Here" should be displayed. If for any reason it got through that check and it is empty or null when it gets to the foreach loop it will crash. Granted, the error you got isn't very clear but that's what it means.

To find out for sure, put a stop on the foreach line and do a debug. When it gets to that line just mouseover MenuItems and see what pops up. It shouldn't be null or you would never have gotten here but it could be empty.


Quote:
Originally Posted by RWoodmansee View Post
I am implemeting this soulution using Visual Studio 2010 and SQL Express. For the most part I have been able to get through Chap 4 (page 88) except for the use of the 'ForEach' statement when referencing the ENTMenuItemBOList reference.
eg.
foreach (ENTMenuItemBO mi in MenuItems)

I am getting a compile error that the ENTMenuItemBOList does not contain a public declaration for 'GetEnumeration'.

This is happening for the 'foreach' statement in the MenuTabs.cs and the ENTMenuItemBO.cs file.

Did I miss some code somewhere or is there something different between VS 2008 and VS 2010?
The Following User Says Thank You to Mark Bedell For This Useful Post:
RWoodmansee (September 26th, 2012)
  #3 (permalink)  
Old September 26th, 2012, 12:46 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Location: Dalls, TX
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks for the reply. I found the root issue a couple of days ago. I don't remember exactly which reference it was, but I was missing a 'using ...' reference that caused a few things to fail the compiler.....
 


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
foreach tedr BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 1 January 27th, 2010 06:07 PM
Foreach in Chapter 6 sgtwwilson BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 2 January 22nd, 2010 08:57 PM
Getting Error in foreach loop for DataSet bravipandey ADO.NET 2 September 28th, 2005 07:43 PM
"foreach" error BradBrening Pro PHP 2 January 13th, 2005 05:33 PM
php foreach error - will pay fgraph Beginning PHP 0 December 6th, 2004 10:46 PM



All times are GMT -4. The time now is 06:40 AM.


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