私はこの質問に対して相反する結果を見つけ続けています。SQLクエリを実行するこのC#コードを見てみましょう。
using (SqlConnection cn = new SqlConnection(strConnectString))
{
cn.Open();
using (SqlCommand cmd = new SqlCommand(strSQL, cn))
{
cmd.ExecuteNonQuery();
}
//Do I need to call?
cn.Close();
}
それを最後に呼び出す必要がありcn.Close()
ますか?私が尋ねている理由は、トラフィックの多いWebアプリでは、プール内の接続が不足しているためです。