DeleteDatabase is not supported by the provider

筅森魡賤 提交于 2019-12-25 07:24:06

问题


I'm using EF Code First with SQL Express 2012.

Everything worked fine until now. I'm getting this error:

DeleteDatabase is not supported by the provider.

public class SqlServerContext : DbContext
{
    public DbSet<Estimate> Estimates { get; set; }

    public SqlServerContext(String connectionString)
    :base(connectionString)
    {
           Database.SetInitializer(new SqlServerContextInitializer());
    }
}

public class SqlServerContextInitializer : DropCreateDatabaseAlways<SqlServerContext>
{
}

Did anyone have similar problem?

来源:https://stackoverflow.com/questions/22474998/deletedatabase-is-not-supported-by-the-provider

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!