私はこのチュートリアルに従っています: http://chsakell.com/2015/08/23/building-single-page-applications-using-web-api-and-angularjs-free-e-book/
以下は接続文字列です。
<add name="HomeCinema" connectionString="Data Source=(LocalDb)\v11.0;
Initial Catalog=HomeCinema;Integrated Security=SSPI;
MultipleActiveResultSets=true"
providerName="System.Data.SqlClient" />
コマンドラインでupdate-database -verboseを実行しようとすると、次のエラーが発生します。
A network-related or instance-specific error occurred while establishing a connection to
SQL Server. The server was not found or was not accessible. Verify that the instance name
is correct and that SQL Server is configured to allow remote connections.
(provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
付属の LocalDB に接続しようとしていVisual Studio 2013
ます。
出力を見ると:
Target database is: 'HomeCinema'
(DataSource: .\SQLEXPRESS, Provider: System.Data.SqlClient, Origin: Convention).
これはコンストラクタです:
public HomeCinemaContext()
: base("HomeCinema")
{
Database.SetInitializer<HomeCinemaContext>(null);
}
ありがとうございました。