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!
"tutorial error"
B-) Please help me by completing my school survey about computer programmers on my website. Thank you!!! Gerry Lowry +1 705-429-7550 wasaga beach, ontario, canada
B-) Please help me by completing my school survey about computer programmers on my website. Thank you!!! Gerry Lowry +1 705-429-7550 wasaga beach, ontario, canada
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
@ 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 titlemust 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)
B-) Please help me by completing my school survey about computer programmers on my website. Thank you!!! Gerry Lowry +1 705-429-7550 wasaga beach, ontario, canada
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.
(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)
B-) Please help me by completing my school survey about computer programmers on my website. Thank you!!! Gerry Lowry +1 705-429-7550 wasaga beach, ontario, canada
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
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,
ricka6, levib, 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)
B-) Please help me by completing my school survey about computer programmers on my website. Thank you!!! Gerry Lowry +1 705-429-7550 wasaga beach, ontario, canada
gerrylowry
All-Star
20513 Points
5712 Posts
Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Database ...
Mar 24, 2009 05:40 PM|LINK
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;regards,
Gerry (Lowry)
Note: the tutorials do need to be cleaned up. Tutorials are for learning not for debugging!
"tutorial error"
joecar
Member
524 Points
120 Posts
Microsoft
Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Datab...
Mar 24, 2009 05:47 PM|LINK
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
GillouX
Contributor
2330 Points
606 Posts
Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Datab...
Mar 24, 2009 05:48 PM|LINK
check the name of your entity in your edmx file
gerrylowry
All-Star
20513 Points
5712 Posts
Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Datab...
Mar 24, 2009 06:02 PM|LINK
@ 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.
GillouX
Contributor
2330 Points
606 Posts
Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Datab...
Mar 24, 2009 06:09 PM|LINK
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
gerrylowry
All-Star
20513 Points
5712 Posts
Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Datab...
Mar 25, 2009 06:53 AM|LINK
@ 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)
j.channon
Member
126 Points
196 Posts
Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Datab...
Mar 25, 2009 10:50 AM|LINK
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.
gerrylowry
All-Star
20513 Points
5712 Posts
Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Datab...
Mar 25, 2009 12:55 PM|LINK
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)
j.channon
Member
126 Points
196 Posts
Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Datab...
Mar 25, 2009 01:10 PM|LINK
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
gerrylowry
All-Star
20513 Points
5712 Posts
Re: Tutorial 1: c#, f.y.i.: errors in the first ASP.NET MVC tutorial ... Creating a Movie Datab...
Mar 25, 2009 01:28 PM|LINK
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, ricka6, levib, 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)