Re: " //Clean Up managed resources " f&*ck

Tech-Archive recommends: Fix windows errors by optimizing your registry



Oundersn 18 Maj, 22:45, "Nicholas Paldino [.NET/C# MVP]"
<m...@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Koliber,

SqlConnection is a managed resource. An example of an unmanaged
resource is a window handle that you obtained by calling unmanaged code, or
a file handle, or a socket handle, or any kind of pointer or handle that you
are holding onto which is not managed by the CLR.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@xxxxxxxxxxxxxxxxxxxxxxxxxxx

I do not understand why sql connection is as you say managed resource
when file handle
is not managed resource I do not understand the difference between
managed and unmanaged
resource - seem to me that all such resources you are tokin are
unmanaged. They are unamanaged
by GC and with dispose(false) in finalizer should be cleaned - but
maybe i am wrong Shoul there
sql connection be not closed by finalisers and only by dispose - that
is this difference? i do not understand it
good

.



Relevant Pages

  • Re: using statement in C#
    ... >indeed you can't actually free managed resources like that - you can just ... for instance If you close a dataReader (managed resource) or a connection ... > release a reference that your instance might have), ... > released by finalization if a finalizer releases it though - it doesn't ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: " //Clean Up managed resources " f&*ck
    ... If sql connection is managed resource ... why dispose if called from finaliser in pattern above ... I was thinking that finaliser above ... And if sql connection is unmanaged resource ...
    (microsoft.public.dotnet.languages.csharp)