hello,
can someone please tell me if the above example is totally corerct to free OLEDB connection and memory of asp.net applications?thank you very much,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
wc.





Reply With Quote