Hi guys!
I am just confused which to use in
closing an OleDB database connection
I read about connection.dispose and stuff
but right now I am doing this
Try
connection.Open
Catch
Finally
If connection.State = ConnectionState.Open Then
connection.Close()
connection= Nothing
End If
Is this Ok I read about dispose and I am confused when to use it...
Please enlighten me...Thanks!

closing an OleDB database connection
sel
Yes. That would do.
cheers,
Paul June A. Domag
Bohdan
In .Net you cannot explicitly destroy an object. All you can do is mark it as "ready for disposal" so that when the GC (Garbage Collector) runs it would clean the object from the memory. You use the dispose method to mark the object as already disposed. Your code is quite fine, but I suggest commenting out the setting to nothing part and replace it with a dispose() call to the connection...
cheers,
Paul June A. Domag
Pater_Peter
So I instead of connection = Nothing I should just write connection.Dispose, right