Error handling in entlib 5

Topics: Exception Handling Application Block
Jan 25, 2013 at 4:11 PM

I saw the following example in msdn.

exManager.Process(() =>
                        GetDataSet("GetAllCustomers"), "Data Access Policy");

Any idea/technique in disposing db connection or file handle if any in GetDataSet method?
For e-g, should a finally block be added and how? Please advice.
Jan 28, 2013 at 12:13 AM

Using the Exception Handling block is no substitute for managing resources.  The GetDataSet method should release (Dispose) any applicable resources in the method itself.  In the GetDataSet method you can do this with a  "using" or a try/finally block.

--
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to