VistaDB 6
VistaDB.Provider Namespace / VistaDBConnection Class / Close Method


In This Topic
    Close Method (VistaDBConnection)
    In This Topic
    Closes the connection to the database. This is the preferred method of closing any open connection. Closes the connection to the database.
    Syntax
    'Declaration
     
    
    Public Overrides NotOverridable Sub Close() 
    'Usage
     
    
    Dim instance As VistaDBConnection
     
    instance.Close()
    public override void Close()
    Exceptions
    ExceptionDescription
    The connection-level error that occurred while opening the connection.
    Remarks

    It is considered a best practice to close the database connection as soon as you are finished with it. Close() is called automatically from Dispose(), so putting the VistaDBConnection instance in a using() statement is the easiest way to ensure that it is cleaned up promptly.

    Since Close() is necessary in order to release the file handle on the database file if you rely on Dispose() of your own object to call this method (or Dispose()) make sure it is when "disposing" and that it is not left for finalizing or an object desctructor call.

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also

    Reference

    VistaDBConnection Class
    VistaDBConnection Members
    Class VistaDBConnection