Closing the DataReader will not Dispose the Command object. But this isn't actually a problem. Unlike the Connection, you don't need to keep the Command alive in order to use the DataReader. So the function which returns the DataReader can Dispose the Command without the client having to worry about it.
Regards, -- Ivan Towlson Thales Contact Solutions -----Original Message----- From: john best [mailto:[EMAIL PROTECTED]] Sent: 18 April 2002 21:19 To: [EMAIL PROTECTED] Subject: [DOTNET] Encapsulating Data access Hi all, I am trying to encapsulate data access. I want to make a function that returns a data reader. If I then close that data reader will it close the command object that was used to open it. (I know it will close the connection) ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. ********************************************************************** You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.