Jaap
Jaap

Reputation: 3220

How do I Update-Database a migration to my azure Db instead of SQLEXPRESS

My web.config has a ConnectionString to an azure database, but the Update-Database command uses (DataSource: .\SQLEXPRESS, Provider: System.Data.SqlClient, Origin: Convention)

How do I tell Visual Studio (the Package Manager Console) to use my azure database?

Upvotes: 1

Views: 408

Answers (1)

Jaap
Jaap

Reputation: 3220

My DbContext missed the default constructor:

public MyDbContext()
  : base("DefaultConnection")
{
}

Especially the base("DefaultConnection") reference to the connection string made it work correctly.

Upvotes: 2

Related Questions