Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5.1 > BOOK: Professional ASP.NET MVC 5
BOOK: Professional ASP.NET MVC 5
This is the forum to discuss the Wrox book Professional ASP.NET MVC 5 by Jon Galloway, Brad Wilson, K. Scott Allen, David Matson; ISBN: 978-1-118-79475-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 5 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 December 28th, 2015, 02:40 PM
Registered User
Join Date: Dec 2015
Posts: 5
Thanks: 1
Thanked 1 Time in 1 Post
Default Chapter 5: I needed to add code in HomeController.cs

This is concerning Listing 5-2 on page 112. I needed to add two code statements:

I added the following at the top of the program:

using MvcMusicStore.Models;
I added the following at the top of class HomeController:

private MusicStoreDB storeDB = new MusicStoreDB();
When I added the following, I got the program to work.
Old September 22nd, 2017, 01:11 AM
Registered User
Join Date: Sep 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Cool Follow Up

I used the
private MusicStoreDB storeDB = new MusicStoreDB();
and it worked for me too. Thank you for posting. I've been stuck on that for awhile.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 4: I needed to add more code in Global.asax.cs Glickt BOOK: Professional ASP.NET MVC 5 0 December 16th, 2015 04:04 PM
AJAX code needed for Chapter 7 Fenlander BOOK: Professional ASP.NET MVC 2 1 November 24th, 2010 10:05 AM
Add textbox in cs file khorshid_sh ASP.NET 1.0 and 1.1 Basics 2 April 30th, 2008 02:37 PM
Chapter 7 p 214 code didn't work, changes needed.. jmurdock BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 June 20th, 2004 09:06 PM

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