「C Sharpとデータベース - データベースの接続」の版間の差分

📢 Webサイト閉鎖と移転のお知らせ
このWebサイトは2026年9月に閉鎖いたします。
新しい記事は移転先で追加しております。(旧サイトでは記事を追加しておりません)

文字列「<source」を「<syntaxhighlight」に置換
文字列「</source>」を「</syntaxhighlight>」に置換
42行目: 42行目:
     return builder.ToString();
     return builder.ToString();
  }
  }
  </source>
  </syntaxhighlight>
<br>
<br>
===== app.configまたはweb.configから取得する方法 =====
===== app.configまたはweb.configから取得する方法 =====
58行目: 58行目:
     return ConfigurationManager.ConnectionStrings["sqlsvr"].ConnectionString;
     return ConfigurationManager.ConnectionStrings["sqlsvr"].ConnectionString;
  }
  }
  </source>
  </syntaxhighlight>
  <syntaxhighlight lang="xml">
  <syntaxhighlight lang="xml">
  <!-- app.configまたはweb.config -->
  <!-- app.configまたはweb.config -->
72行目: 72行目:
   </connectionStrings>
   </connectionStrings>
  </configuration>
  </configuration>
  </source>
  </syntaxhighlight>
<br><br>
<br><br>


117行目: 117行目:
     }
     }
  }
  }
  </source>
  </syntaxhighlight>
<br>
<br>
===== トランザクションを用いる方法 =====
===== トランザクションを用いる方法 =====
176行目: 176行目:
     }
     }
  }
  }
  </source>
  </syntaxhighlight>
<br><br>
<br><br>


__FORCETOC__
__FORCETOC__
[[カテゴリ:C_Sharp]]
[[カテゴリ:C_Sharp]]