顯示具有 MVC 標籤的文章。 顯示所有文章
顯示具有 MVC 標籤的文章。 顯示所有文章

2012年12月4日 星期二

Unable to retrieve metadata for 'MvcMusicStore.Models.Album'.

When you practice this Tutorials at MVC Music Store. You may got this error message when you create the StoreManagerController: "Unable to retrieve metadata for 'MvcMusicStore.Models.Album'."


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

to:
<add name="MusicStoreEntities" connectionString="Server=(LocalDB)\v11.0; Integrated Security=true; AttachDbFileName=|DataDirectory|MvcMusicStore.mdf" providerName="System.Data.SqlClient"/>