correct way to free memory
hello,
can someone please tell me if the above example is totally corerct to free OLEDB connection and memory of asp.net applications?
VB Code:
'connection
Dim StrConnect as String, StrOpen as string
Dim DBconn As OleDbConnection, DBcomm as OleDbCommand, DBread as OleDbDataReader
StrConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=mydb.mdb"
DBconn=New OleDbConnection(StrConnect) 'connection to DB
DBconn.Open()
'connect
Stropen="Select * " & _
"FROM structure " & _
"WHERE " & _
"(pid = " & pid & ")"
DBcomm=New OleDbCommand(Stropen,DBconn)
DBread=DBcomm.ExecuteReader()
if DBread.read() then
Title.text = DBread("name")
end if
DBread.close()
DBconn.close()
'free memory
DBcomm.dispose()
DBconn.dispose()
DBread = nothing
thank you very much,
wc.