This might be a very simple question, but more or less, I'm asking to so I can wrap my head around how Data Access blocks opens and closes connections.
First, I have used something like the Enterprise Library for about 10 years, and have switched back and forth between Entities, etc.
Anyway, when I use the CreateDatabase() function of the Database class, does this open a connection immediately to the database OR does it open a connection when I actually make a call using something like ExecuteReader?
How does it handle closing the connection? Do I explicitly have to call the closing of the connection after using it in a DAL? How does Enterprise Library insure the connection is closed after I'm done with the Reader, etc?
Also, what is the best practices for opening and closing the connection IF CreateDatabase opens the connection immediately? Have a small sample of code to share?