Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

Rate It (3)

Last post 03-26-2009 2:46 PM by ricka6. 20 replies.

Sort Posts:

  • Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-24-2009, 1:40 PM
    • Contributor
      6,711 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,281

    Creating a Movie Database Application with ASP.NET MVC (C#)   http://www.asp.net/learn/mvc/tutorial-21-cs.aspx

    Error 1 The type or namespace name 'MoviesDBEntities' could not be found (are you missing a using directive or an assembly reference?)
                C:\ ...  \Controllers\HomeController.cs 13 17 MovieApp
     

    Solution:       add                                 using MovieApp.Models;

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    using System.Web.Mvc.Ajax;
    using MovieApp.Models;
    
    namespace MovieApp.Controllers
    {
        public class HomeController : Controller
        {
            private MoviesDBEntities _db = new MoviesDBEntities();
    
     


    regards,
    Gerry (Lowry)

    Note:  the tutorials do need to be cleaned up.  Tutorials are for learning not for debugging!
    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
    Filed under:
  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-24-2009, 1:47 PM
    Answer
    • Member
      488 point Member
    • joecar
    • Member since 03-05-2007, 5:35 PM
    • Posts 112
    • AspNetTeam

    This was changed for RTM, I sent mail to the author of the tutorial and we will get it updated.

     

    thanks for the catch,

    joecar

  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-24-2009, 1:48 PM
    • Contributor
      2,070 point Contributor
    • GillouX
    • Member since 06-03-2007, 3:28 PM
    • Luxemburg
    • Posts 566

     check the name of your entity in your edmx file

  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-24-2009, 2:02 PM
    • Contributor
      6,711 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,281

    @ GillouX  ....hi, I am not sure what you are saying ... the solution was to add the using statement.

                       joecar says RTM broke the tutorial ... although I do not understand why/how (joecar   ???).

        GillouX, could you clarify please and thank you.

    g.

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-24-2009, 2:09 PM
    • Contributor
      2,070 point Contributor
    • GillouX
    • Member since 06-03-2007, 3:28 PM
    • Luxemburg
    • Posts 566

     I mean the using statement just make avaiable the library under ...Models namespace.

     your edmx file is so in the model template

    if it's the case; there is no reason it shouldn't work except if your entity doesn't not have the same name but I don't think it's your problem anyway :D

  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-25-2009, 2:53 AM
    • Contributor
      6,711 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,281

    @ joecar ....... Joe, you are welcome.  Here's another problem with this tutorial:

    Stephen Walther, above Figure 13 claims:

              Notice that you get form validation automatically.
              If you neglect to enter a release date for a movie, or you enter an invalid release date,
              then the form is redisplayed and the release date field is highlighted.

    This above claim is misleading.

             Id                    int                    No Nulls
            Title                 nvarchar(100)     No Nulls
             Director           nvarchar(100)     No Nulls
             DateReleased  datetime           No Nulls

    Examples of validation that is not automatic:
       -- it is possible to enter only a date
       -- it is possible to enter duplicate records

    Since it is clearly a tutorial and since tutorials are for teaching,
    it should assume the person working through the tutorial is not
    Stephen Walther.  Therefore it should say WHAT kind of automatic
    validations are possible, how to enable various kinds of automatic
    validations, and how to code standard non-automatic validations
    such as director must be non blank and movie title must be non blank.

    The tutorial concludes "I hope that you discovered that building an
    ASP.NET MVC web application is very similar to the experience
    of building an Active Server Pages or ASP.NET application."  It's
    not.  Building an ASP.NET WebForms with code behind is very
    different.  The paradigms are different.

    Regards,
    Gerry (Lowry)

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-25-2009, 6:50 AM
    • Member
      126 point Member
    • j.channon
    • Member since 05-18-2006, 11:23 AM
    • Posts 194

     I am very much in agreement with you here Gerry.

    If Linq to SQL can map your tables and columns so well then surely the MVC platform should be able to tell that a column/property has a NOT NULL attribute.

    Therefore if you have a string column that is marked as NOT NULL why do we have to add our own  RuleViolation class to check that this property is not empty and not null, this should be built in.

  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-25-2009, 8:55 AM
    • Contributor
      6,711 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,281

    Yes, there are at least two issues here.

    (1) the tutorials need to be improved such that

         (a) they work and they work as intended by the designers with the RTM and

         (b) the tutorials also help the learner understand the boundaries of ASP.NET MVC v1.0.

    (2) small and frequent bug free incremental releases precede  ASP.NET MVC v1.0

         example:
           
    ASP.NET MVC v1.01 ~~ recognizes NOT NULL column/property;
                                                 generates appropriate validation edits automatically
                                            ~~ [optionally] prevents duplicate records

    Features like the optional prevention of duplicate records could be controlled
    via [attribute] usage. 

    regards ~~ gerry (lowry)

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-25-2009, 9:10 AM
    • Member
      126 point Member
    • j.channon
    • Member since 05-18-2006, 11:23 AM
    • Posts 194

     Agreed, however is this a developer led community? Do MS read these forums and add the requests to new releases? Is it worth setting up a new thread with ASP.NET MVC 1.01 requests

    One other issue I have is with ValidationMessage, there should be an overload method that allows option of message appearing in a ValidationSummary

  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-25-2009, 9:28 AM
    • Contributor
      6,711 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,281

    Yes, Microsoft has people assigned to these forums AFAIK.

    I also imagine that the ASP.NET MVC team members also lurk here too.

    Microsoft people examples:  joecar, ricka6levib, and jeloff are ASP.NET team members.

    I've seen occasional postings by Phil Haack and Scott Guthrie too.

    There are also MVPs who likely are an audience that has access to Microsoft's "ear".

    Regards,
    Gerry (Lowry)

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-25-2009, 9:36 AM
    • Member
      126 point Member
    • j.channon
    • Member since 05-18-2006, 11:23 AM
    • Posts 194

     Is it worth setting up a request thread with strict rules where people cannot comment they just put their requests in and then the MVC team can decide what they want to include?

  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-25-2009, 9:44 AM
    • Contributor
      6,711 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,281

    As long as Microsoft is following the ASP.NET MVC forum, I think individual
    posts on issues as part of the forum is a better approach.  That way there
    will be debate and discussion.  Personally, I like to see open discussions
    over ones that are behind closed doors.  Plus, I suspect that hearing our
    collective voices aids the ASP.NET MVC team in setting democratic priorities.

    g.

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-25-2009, 9:58 AM
    • Member
      126 point Member
    • j.channon
    • Member since 05-18-2006, 11:23 AM
    • Posts 194

     Is there a MVC roadmap? Just wonder when they plan on releasing the next incremental release or if they are just going to release MVC 2.0

  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-25-2009, 10:24 AM
    • Contributor
      6,711 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,281

    Sorry, I'm just a low level community member ... don't know.  It may be possible
    to get some hints from the "futures" published along with the "ASP.NET MVC v1.0 Source"
    at  http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471.

    If we are lucky, the ASP.NET MVC team will respond to your question.
    I suggest that you start it as a new thread.

    gerry

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
  • Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database Application with ASP.NET MVC (C#)

    03-25-2009, 10:53 AM
    • Contributor
      6,711 point Contributor
    • gerrylowry
    • Member since 07-03-2008, 1:46 AM
    • alliston ontario canada
    • Posts 2,281

    minor editorial point (following Figure 13):

    Editing Existing Database Records

    In the previous sections, we discussed how you can list and create new database records.
    In this final section, we discuss how you can edit existing database records.


    I can not imagine ever editing non-existing database records.      gerry

     

    Gerry Lowry, Principal
    Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
    68 John W. Taylor Avenue
    Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com

    Websites:
    http://abilitybusinesscomputerservices.com
    http://gerrylowryprogrammer.com ~~ résumé & testimonials
    http://veganoccasions.com ~~ recipes by Susan
Page 1 of 2 (21 items) 1 2 Next >