Disposing SqlCommand
问题 Because SqlCommand implements IDisposable , I would normally approach an ADO query as follows. using (SqlConnection connection = new SqlConnection(connectionString)) using (SqlCommand command = new SqlCommand(query, connection)) { // Execute command, etc. here } However, what if I need to execute multiple commands during a single connection? Do I really need a new using block for each command? The examples I found from Microsoft don't use a using block for SqlCommand s (or even call Dispose()