Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IDisposable Mysteries
Message
From
14/04/2011 17:57:29
 
 
To
13/04/2011 14:57:12
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Miscellaneous
Thread ID:
01506168
Message ID:
01507410
Views:
41
>>Always check whether a .NET or third-party class implements IDisposable() and, if so, call the Dispose() method when you're finished with it. (There are exceptions to this - sometimes a class (e.g. ADO.NET Connection) will expose a Close() method and using this is preferable)
>
>Close is preferrable to Dispose? Is that just because you're explicitly closing the connection, or is there another reason? I usually do the close as the last line in my using block. Actually, I haven't used any ADO.NET classes for a looong time.


I wouldn't say "preferrable", I'd say "interchangeable".

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform