Monday 15 September 2014

sql server - What gets disposed when SqlCommand.Dispose is called? -


itemprop = "text">

After implementing SqlCommand IDisposable, a SqlCommand object must always be settled. I personally wrap one of the experiment statements around me. However, I see a lot of code that resolves the SqlCommand object without any obvious problems.

I understand that the final providers will eventually call for garbage collection, but since in most cases (and never at all) other reasons why the code is not crashing due to running out of resources?

In our own code base we have a code that runs 24x7 without settling orders. I would like to clean it, but when it is not causing any problems, then it is difficult to justify it. I like the base class call (component) settlement method, and the garbage collection starts jumping. If the disposal of public sub-disposals (disposed in the form of settlement in the form of settlement), then settlement ', then in case of the same disks (s) in the lock of the lock (if I do not have software and nothing). So me Sight. There is no container, I do not have anything. again. Container Remove (m) and if if I If there is no avant, Dim Handler as EventHandler. Item (component.eventdispended), EventHandler) If there is a handler, then nothing handler. Invoch (m, event.rg.free) end if end of termination lock end if GC.SuppressFinalize (I) ending sub

I found it using.


No comments:

Post a Comment