Author: Pallen2412 | Posted on: 6/5/2008 2:46:15 AM | Views : 880

I've always been told that passing data readers between classes (in the same tier) is bad?

 For example, I have a basedal class that contains a method that returns a data reader

Then, still in my DAL I have a method that calls the basedal method to return a data reader. This then populates a DTO object and returns an array to the business logic.

In the data access section, i was told that this is bad practice even though in my DAL i'm closing the data reader explicitly (even if its in a different class to where it was opened).

However, when i downloaded the Data Access Application Block from MSDN, it passes a data reader back exactly the same why i am...

Could someone clarify? Is passing a data reader to a calling class bad, when the calling class then closes the datareader after its finished?
...

Go to the complete details ...