あなたはMSDN: Entity Framework Config File Settings
例web.configファイルで設定について読むことができますかもしれない:
<?xml version="1.0"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<connectionStrings>
<add name="MyConnectionString" connectionString="Data Source=MySqlServerInstance;Initial Catalog=MyDatabase;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb"/>
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
</providers>
</entityFramework>
</configuration>
出典
2017-10-17 07:28:39
ChW
あなたは何のSQL Server 2016の**版**をインストールしたのですか?インストール時にインスタンス名を指定しましたか? SQL Server 2016 ** Express **はデフォルトで '。\ SQLEXPRESS'としてインストールされますが、他のエディションは通常、デフォルトの名前のないインスタンスとしてインストールされます(' .'または '(local)'を使用してサーバー/インスタンス名) –
エンタープライズエディションと何も指定していません –
したがって、接続文字列は 'Data Source =(local);初期カタログ=(あなたのデータベース名);統合セキュリティ= SSPI;またはそのようなもの - あなたが使っているものを私たちに(あなたの質問を編集/更新して)見せてもらえますか? –