RE: About Dispose

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

From: Richard Blewett [DevelopMentor] (richardb_at_develop.com)
Date: 10/14/04


To: microsoft.public.dotnet.languages.csharp
Date: Thu, 14 Oct 2004 01:39:11 -0700

Well in that case the documentation is fundementally wrong. SImply looking at SqlConnection in Reflector shows you that SqlConnection does implement IDisposable - it, however, implements it explcitly because having both a Close and a Dispose method on the public face of the type would be confusing. As far as connection pooling and Dispose are concerned, there is a whole bunch of misinformation out there about this. Dispose simply calls Close and clears the connection string (so you can't call Open again). It does not, as some people claim, remove the connection from the connection pool.

 Regards

 Richard Blewett - DevelopMentor
 http://staff.develop.com/richardb/weblog

   
 DB Note: If you read the documentation for the IDisposable interface you
 will note that SqlTransaction & SqlDataReader both implement IDisposable but
 SqlConnection does NOT - this is due to connection pooling I think. The
 Oracle DB classes are similiar in behavior...
 
 

 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004

 
 [microsoft.public.dotnet.languages.csharp]