03-29-2015, 09:03 AM
because the garbage collector does not clean/release unmanaged objects. He does take care of managed resources (most of the resources you will use are managed).
You have to take care of unmanaged resources for example via the Dispose pattern because the GC "does not know how to release and clean the unmanaged resource" but is able to track the lifetime of it.
Read my post carefully again. I just added a side note how to implement that pattern if he is planning to work with unmanaged resources but my main purpose was to tell him that there is no need to call reader.Close() at all because the using statement calls the Dispose() method and does that internally.
In my oppinion it's allways good to know how things work and what actualy the using() directive does. This was an explanation.
Okey, yeah now i know what u mean haha, thats good to know ofc.

