ExecuteScalar opens a connection and performs the operation(s) and then disposes of the connection (which will close the connection) so there is no need to close the database connection. In this case, Enterprise Library handles this for you. One scenario
where you do
need to worry about connections is when calling ExecuteReader since this returns an IDataReader which contains an open database connection. The IDataReader should be disposed/closed when done/ The easiest way to do this is with
a using block.
Also, technically, in the posted code you should Dispose the DbCommand (although for SqlCommand this is usually not a huge problem (it doesn't cause connections to be orphaned without being closed and returned to the pool).
Enterprise Library support engineer