Coming from a windows platform application development background I am wondering how ASP handles connections to the SQL Server.
In my code I connect to the DB from various places and for various reasons. But I am not setting these objects to nothing afterwards. For instance to fill a combo box with related data from the DB:
'JOBS DROPDOWN
'objJob = ttsController.ListTTS_JobTypes(Session("empBureauID"), Session("empCompanyID"))
objJob = ttsController.TTS_GetJobs(Session(
"empBureauID"
), Session(
"empCompanyID"
), Session(
"CurrentEmployeeID"
), sDept)
ddlEditJob.Items.Clear()
If
objJob.Count > 0
Then
For
Each
objTTS3
As
TTS_JobInfo
In
objJob
Dim
itemJob
As
New
ListItem
itemJob.Text = objTTS3.JobID.Trim &
" | "
& objTTS3.JobName.Trim
ddlEditJob.Items.Add(itemJob.Text)
Next
End
If
so if the objJob is not set to nothing Does .net close it when leaving the sub?
Or am I leaving it open and therefore wasting resources and or data handles?
Will this eventually hoq up all my SQL resources?
Is there a better (or standard) way to handle this?
Thanks