6
The dispose()
frees the object from memory, right? I don’t know when it is necessary to use it. For example, I have a page, on this page there is a listBox
with
visible = "false"
, in an event this listBox
becomes true
.
In another event the div
containing this listBox
is hidden: display: none
. To listBox
which was filled previously continues to occupy the memory, does it not? It just does not appear on the screen because the div
was hidden. The moment I hid the div
it would be advisable to give a dispose()
in the listBox
since it is not being used (shown on the screen)? The listBox
will only appear again if the user clicks the button that fires the event to fill it again.
In the first implementation of the record button click method we should have used the Dispose() connection method. With the use of instruction this is no longer necessary. Research about the purpose of the Dispose() method and why the using statement dispenses with the use of the same?
– Tiago Duarte da Costa