Web.config

接続文字列の定義

  • connectionStringsタグの中に書く
(例)
<connectionStrings>
   <add name="SampleContext" connectionString="Data Source=(LocalDb)\v11.0; >>>
   AttachDbFilename=|DataDirectory|\Sample.mdf;Integrated Security=True" providerName="System.Data.SplClient" />
</connectionStrings>
  • nameは接続名。コンテキストクラスの名前と同じである必要がある
  • 接続文字列の書き方は下記参照

タグ:

+ タグ編集
  • タグ:

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

最終更新:2015年12月31日 00:10