Hi all, I have an assembly that takes care of all data requests (ie contains sql connections, db2, and oledb). When I instantiate the class for this, and call one of the "fill" methods, it creates a SqlDataAdapter and also a SqlCmd. The "fill" method then calls another method that actually executes the fill while creating a SqlConnection. In this method, the finally statement does a conn.Close(), but does not do a conn.Dispose(). Also, the original calling method (the first "fill" method) does not dispose of the SqlCommand.
Question, do I need to be closing out those resources to prevent a memory leak?
Also, if you have a return statement inside a try block, will it still hit the finally statement?
Thanks!
Question, do I need to be closing out those resources to prevent a memory leak?
Also, if you have a return statement inside a try block, will it still hit the finally statement?
Thanks!