8
Dois-je fermer () un SQLConnection avant qu'il ne soit supprimé?
Par mon autre question ici sur les objets jetables , devrions-nous appeler Close () avant la fin d'un bloc using? 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 …