Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
.Dispose
Message
From
21/03/2006 12:47:02
 
 
To
21/03/2006 12:32:18
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01106252
Message ID:
01106290
Views:
22
Craig,

Did your book talk about parts of dotnet that do run unmanaged. Ado and GDI both run unmanaged, so you should call dispose.

My understanding is that's one of the reasons for creating your connection in a "Using..." block in C#. It implicitly calls dispose when the block is done.

>You shouldn't need to ever call .Dispose(), unless you're calling unmanaged code, as .Net handles garbage collection for you. Calling .Dispose() too often can cause performance problems.
>
>I'm working my way through this book http://www.amazon.com/gp/product/1590594193/sr=8-1/qid=1142962272/ref=pd_bbs_1/103-4786778-9535042?%5Fencoding=UTF8
>
>It's helped my understanding of how .Net works and explains garbage collection.
>
>
>
>>I haven't received any formal training with .NET. Since I am mostly self-taught, there are quite a few things I do just because I read somewhere I need to do them, and not understanding why.
>>
>>One of these is the .Dispose routine. Do I need to be calling this, and if so for what? When I declare certain things like datasets, forms, and other objects I just check to see if I can dispose of them, and if I can then I do.
>>
>>I understand the concept of Garbage Collection for the most part, so shouldn't that be enough?
>>
>>I would appreciate any advice!
>>
>>Thanks,
>>Mike

(On an infant's shirt): Already smarter than Bush
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform