This project is read-only.

Chapter 4: Querying the Database error

Jul 16, 2014 at 9:06 PM
Edited Jul 16, 2014 at 9:10 PM
Hey guys, i'm still having an error when i'll run my project, the exception appears on this method:
public ActionResult Index()
        var genres = storeDB.Genres.ToList();
        return View(genres);
And, this is my connection string:

<add name="MusicStoreEntities" connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf" providerName="System.Data.SqlServerCe.4.0" />

And i have Entity imported in every class following the tutorial:
using System.Data.Entity;

And the following error is displayed:
No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.4.0'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See for more information.

I search on other discussions and don't know what i need to do here, i do the download of sql server CE, but, when i go install the message is displayed saying that i already have it installed, anybody can help me?

Thanks all
Jul 17, 2014 at 3:25 PM
Edited Jul 17, 2014 at 3:26 PM
Hey guys, I fixed it creating new project in VS 2013..
Please, when you'll select the project template, don't choose "Empty" project, you must be use "Basic" template, because it'll come with EF installed, and Empty isn't..
Aug 8, 2014 at 8:12 PM
what did you do to fix it?