Should I implement IDisposable here?
- by dotnetdev
My method which calls SQL Server returns a datareader but because of what I need to do (return the datareader to the calling method which is in page code-behind), I can't close the connection in the class of the method which calls sql server, so I have no finally or using blocks.
Is the correct way of disposing resources to make the class implement IDisposable? Or from the caller, explicitly dispose the unmanged resource (class-level fields)?
Thanks