I want to handle the connection to my database and the return of a SqlDataReader from a single routine and be able to reuse it many times from different areas of my code. However, to avoid memory leaks I need to make sure that the reader and the connection are both properly disposed of since there will be lots of data to plow through.

How do you properly handle the disposal of the SqlDataReader and SqlConnection when you return the SqlDataReader to your calling routine? Would the SqlDataReader be returned by reference? If it is, I can dispose of it from within the calling routine, but what would I do about the SqlConnection object?

Thanks