I'm a complete newbie in ASP.NET MVC 4. I'm following this nice tutorial about ASP.NET MVC,
And I'm stuck at one point.
I'm trying to add a new Controller called MoviesController.cs
, but Visual Studio 2010 is yielding the error :
Unable to retrieve metadata for 'MvcMovie.Models.Movie'. Invalid value for key 'attachdbfilename'.
I think by attachdbfilename
, it is referring to this line in Web.Config file :
<add name="MovieDBContext" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True"
providerName="System.Data.SqlClient" />
I have also searched for this in StackOverFlow, one solution was to install Microsoft SQL Server Compact 4.0, I installed it but nothing changed.
May be related:
I also have WAMPServer installed on my Windows 7 64-bit, but I have stopped all services and closed the application before I did anything.
So how do I solve this issue?
Thanks !
Edit
Now I started to think that |DataDirectory| Should be changed with a path. is it true? if so, which path?
And what is this Movies.mdf file? Is is some kind of .sql file? And should I have already created it at some location?