J
Jay B. Harlow [MVP - Outlook]
Cor,
No that guy is "correct", note that he states "The only difference is that
Dispose *also* clears the connection
string."
Notice the word "also" in there; using Reflector (or ILDASM) one can see
that SqlConnection.Dispose(Boolean) clears the connection string, then calls
Close. Dispose also does some pool cleanup work...
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
| Herfried,
|
| You mean that this guy is wrong, I think that somebody has to inform him
| before things go really wrong.
| Because that you have seen this, than maybe can you send him a message.
|
|
http://groups.google.com/group/microsoft.public.dotnet.framework.adonet/msg/515919344c3c556a
|
| The only thing you can say is that the dispose is generic used in the
using
| statement.
| But in that is as well not generic a catch, something I am not so happy
| with,
|
| Cor
|
| "Herfried K. Wagner [MVP]" <[email protected]> schreef in bericht
| | >> Feel free to do it that way.
| >>
| >> You probably set as well all used values at null at the end of a
method?
| >
| > Sorry Cor, but Göran is right. It definitely makes sense to call the
| > 'Dispose' method whenever its available because implementing the
| > 'IDisposable' interface simply says "call the 'Dispose' method after
using
| > the object to free unmanaged resources occupied by the object". Even if
| > currently no unmanaged resources are released at all inside the method's
| > implementation, this might be the case in a future version. There are
| > some rare cases where I'd not call the 'Dispose' method, but the reason
| > for this is mainly that I do not care about the time when the resources
| > are released.
| >
| > --
| > M S Herfried K. Wagner
| > M V P <URL:http://dotnet.mvps.org/>
| > V B <URL:http://classicvb.org/petition/>
|
|
No that guy is "correct", note that he states "The only difference is that
Dispose *also* clears the connection
string."
Notice the word "also" in there; using Reflector (or ILDASM) one can see
that SqlConnection.Dispose(Boolean) clears the connection string, then calls
Close. Dispose also does some pool cleanup work...
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
| Herfried,
|
| You mean that this guy is wrong, I think that somebody has to inform him
| before things go really wrong.
| Because that you have seen this, than maybe can you send him a message.
|
|
http://groups.google.com/group/microsoft.public.dotnet.framework.adonet/msg/515919344c3c556a
|
| The only thing you can say is that the dispose is generic used in the
using
| statement.
| But in that is as well not generic a catch, something I am not so happy
| with,
|
| Cor
|
| "Herfried K. Wagner [MVP]" <[email protected]> schreef in bericht
| | >> Feel free to do it that way.
| >>
| >> You probably set as well all used values at null at the end of a
method?
| >
| > Sorry Cor, but Göran is right. It definitely makes sense to call the
| > 'Dispose' method whenever its available because implementing the
| > 'IDisposable' interface simply says "call the 'Dispose' method after
using
| > the object to free unmanaged resources occupied by the object". Even if
| > currently no unmanaged resources are released at all inside the method's
| > implementation, this might be the case in a future version. There are
| > some rare cases where I'd not call the 'Dispose' method, but the reason
| > for this is mainly that I do not care about the time when the resources
| > are released.
| >
| > --
| > M S Herfried K. Wagner
| > M V P <URL:http://dotnet.mvps.org/>
| > V B <URL:http://classicvb.org/petition/>
|
|