これは、Entity Framework クラス ライブラリを参照する WPF アプリです。クラス ライブラリ プロジェクトの App.config には、次のようなものがあります。
<?xml version="1.0" encoding="utf-8"?>
<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=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
</configuration>
すべて非常に標準的です。私がやりたいことは、データベースへの URL を介してリモート サーバーに接続できるようにする接続文字列を追加することです。これは可能になるでしょうか?
私はこのようなことを試しました:
<connectionStrings>
<add name="LanguageEntities" connectionString="metadata=res://*/LanguageModel.csdl|res://*/LanguageModel.ssdl|res://*/LanguageModel.msl;provider=System.Data.SqlClient;provider connection string="data source=http://www.myweb.net:667;User ID=Remote;Password=cleverstring;initial catalog=LanguageModel.LanguageEntities;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
しかし、私のアプリはデフォルトでローカル接続になっているようで、エラー メッセージは表示されません。
どんな提案もありがたく受け取った。
どうもありがとう!