Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5.1 > BOOK: Professional ASP.NET MVC 5
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 28th, 2015, 02:40 PM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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:

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

Code:
private MusicStoreDB storeDB = new MusicStoreDB();
When I added the following, I got the program to work.
Reply With Quote
  #2 (permalink)  
Old September 22nd, 2017, 02:11 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2017
Location: Sandy, UT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Cool Follow Up

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


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
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 03: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 10:06 PM



All times are GMT -4. The time now is 03:30 PM.


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