2012-12-07 64 views
-1

嗨,我剛開始學習asp.net MVC和試圖添加一個新的控制器我得到這個錯誤:無法檢索元數據,無法找到所需的.NET Framework數據提供

enter image description here

這是我提出了configurationg:

enter image description here

這是我的代碼:

public class Movie { 
    public int ID { get; set; } 
    public string Title { get; set; } 
    public DateTime ReleaseDate { get; set; } 
    public string Genre { get; set; } 
    public decimal Price { get; set; } 
} 

public class MovieDBContext : DbContext 
{ 
    public DbSet<Movie> Movies { get; set; } 
} 

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

我在做什麼錯?

+0

沒有ü安裝Microsoft SQL Server精簡4.0嗎? – YogeshWaran

回答

1

根據你的連接字符串,我認爲你正在嘗試連接到SQL Server CE數據庫 只需將其更改爲常規Sql 2008/Sql 2012連接字符串。

應工作

-1

連接字符串

DataSource=.\App_Data\Movies.sdf 
相關問題