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
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?
|