I'm trying to pick up ASP.Net - and after the mvc tutorial: http://www.asp.net/mvc/tutorials/mvc-music-store-part-4 (Note: I am completely new to the .Net framework, like C # , and ASP.Net)
At the beginning, the tutorial suggests using SQL Server Compact 4.0. But instead, I installed SQL Server Express (since I will use it after, and not just for the tutorial). I had another question related to setting up a db connection: ASP.Net SQL ConnectionStrings config
Now, it’s obvious that the database is empty - the tutorial doesn’t even say about creating a database instance, except loading some asset file for db "SampeData.cs" and adding it to the Global.asax.cs Application_Start method:
System.Data.Entity.Database.SetInitializer(new MvcMusicStore.Models.SampleData());
So, I connected DB, but now I get:
Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions.
When I add a debug point, sometimes the Application_Start method is used, sometimes it is not. However, I never see the Seed method in SampleData.cs ever hit - so it seems to me that my problem right now is sowing db
source
share