Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I want to Ask you one thing

 

When we define some new object such as connection object or some sql command with in a procedure or sub

 

what happend to them after the function is over ? such as after Exit sub

 

are they remain in the memory or they are disposed off automatically ?

The one and only

Dr. Madz

eee-m@il

  • *Experts*
Posted

They are disposed of, but there is no guarantee that the memory will be freed right away. There should be no problem with memory.

 

Also, if only for code readability, you should close all connections explicitly. I would tend to let .NET do as little automatically as possible (within reason, of course).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...