Pro meiner anderen question here about Disposable objects, sollten wir Close() vor dem Ende eines Verwendungsblocks aufrufen?Muss ich eine SQLConnection schließen(), bevor sie entsorgt wird?
using (SqlConnection connection = new SqlConnection())
using (SqlCommand command = new SqlCommand())
{
command.CommandText = "INSERT INTO YourMom (Amount) VALUES (1)";
command.CommandType = System.Data.CommandType.Text;
connection.Open();
command.ExecuteNonQuery();
// Is this call necessary?
connection.Close();
}
Ist _this._poolGroup = null; _ bedeutet, dass die Verbindung nicht zum Verbindungspool zurückkehrt? also werde ich n-1 Verbindungen haben? –