Does Dispose still get called when exception is thrown inside of a using statement?
In the example below, is the connection going to close and disposed when an exception is thrown if it is within a using statement?
In the example below, is the connection going to close and disposed when an exception is thrown if it is within a using statement?
I was wondering if there was some sort of cheat sheet for which objects go well with the using statement… SQLConnection, MemoryStream, etc.
Suppose I have the following:
Both classes for practicality sake are disposable.