Re: What is the difference between Dispose and Close

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



<beyondanydoubt>Close will return the underlying physical connection to the
connection pool.</beyondanydoubt>

No clue what Angel was saying - can you point to some written text from him?

- Sahil Malik [MVP]
Upcoming ADO.NET 2.0 book - http://tinyurl.com/9bync
----------------------------------------------------------------------------
---------------


"Cor Ligthert" <notmyfirstname@xxxxxxxxx> wrote in message
news:uH3U2KFbFHA.3132@xxxxxxxxxxxxxxxxxxxxxxx
> Bill,
>
> > As far as pooling behavior, Dispose and Close both return the Connection
> > to the pool for reuse. Each of the .NET providers implements a
Connection
> > pool--it's part of the core functionality.
> >
> Why were there than so many people in these newsgroup, who had problems
with
> the Connection Pool, for whom, after that I advised to change the close
for
> dispose (according to the messages from Angel), the Connection pool
problems
> were gone?
>
> Cor
>
>


.



Relevant Pages

  • Re: Dispose vs Close
    ... When it is about Dispose vs Close often Angel jumps in. ... Angel has written this moreoften in detail in this newsgroup. ... > releasing the connection back to the connection pool where a close does ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SqlConnection.Dispose close connection?
    ... By the way - I've heard somewhere that calling Dispose() on an SqlConnection ... instance removes this connection from the connection pool, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: .NET connection pool problems
    ... Dispose at all. ... Connections are returned to the connection pool by simply ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Global connection variable
    ... commands across various pages. ... Consider using a DAL instead, which will fetch ... connections from the connection pool as and when needed, and dispose of them ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: connections using this database: 105
    ... it's very important to call Dispose on many of the disposable ... Dispose frees the connection back into the ... connection pool. ... >> Are you explicitly closing and disposing your connections? ...
    (microsoft.public.dotnet.framework.aspnet)