I am reviewing an application that uses Microsoft Application Blocks for Data Access to interact with the database. The application calls a function and pass a query into it. The function creates a DataReader object using Data Access application blocks (for the given query) and returns the DataReader to the caller.
The application closes DataReader object when it is done. The question I have is, whether closing the DataReader object automatically closes the underlying connection object or not. It is not clear to me whether the Data Access Application Block opens the command object with the "CommandBehavior.CloseConnection" flag.
Questions:
Thanks in advance
http://msdn.microsoft.com/en-us/library/system.data.commandbehavior.aspx
CloseConnection: When the command is executed, the associated Connection object is closed when the associated DataReader object is closed.