chaosmaster Posted February 26, 2004 Posted February 26, 2004 In order to fully clean up an OleDbConnection, do I explicitly need to close any OleDbDataReaders or can I simply call the .close() method on the connection? Thanks! Quote
Spiel79 Posted February 27, 2004 Posted February 27, 2004 You might want to dispose of any commands before closing the connection: Dim MyCommand As New OledbCommand("your command string here") Dim MyReader As OledbReader(MyCommand, MyConnection) MyReader.ExecuteReader() 'Continue with the rest of the code... MyCommand.Dispose() MyConnection.Close() Hope that helps Quote
bungpeng Posted February 27, 2004 Posted February 27, 2004 What about this? any comments? If Not IsNothing(Con) Then If Con.State = ConnectionState.Open Then Con.Dispose() Con.Close() End If Con = Nothing End If Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.