VistaDB 6
VistaDB.Provider Namespace / VistaDBConnection Class
Members


In This Topic
    VistaDBConnection Class
    In This Topic
    Represents a connection to a VistaDB database.
    Syntax
    'Declaration
     
    
    <System.ComponentModel.DesignerCategoryAttribute("Component")>
    Public NotInheritable Class VistaDBConnection 
       Inherits System.Data.Common.DbConnection
    'Usage
     
    
    Dim instance As VistaDBConnection
    [System.ComponentModel.DesignerCategory("Component")]
    public sealed class VistaDBConnection : System.Data.Common.DbConnection 
    Remarks

    Connection instances should generally be disposed once they are no longer immediately needed (see example). Connection pooling is supported to reduce overhead such as from closing and re-opening the database file.

    Connection pooling is off by default but can be enabled in the connection string with "Pooling=true". Connection pooling in VistaDB allows connections that have been "closed" (or disposed) to remain open internally within a pool for immediate reuse by the next connection instance for the same database and open mode (and password) within the same process.

    Because connections in a pool keep their file handles open they can prevent other connections with incompatible open modes (such as ExclusiveReadWrite) from being opened. To ensure all connections are closed, call ClearPool to close out pooled connections in a specific pool (for a particular database and open mode) or call ClearAllPools to clear all pooled connections for all pools (all VistaDB databases and open modes in the current process). Clearing the connection pool does not close connections that are in use ("open") and have not been returned to the pool for reuse. Connection pooling is unique to each process.

    Example
    • Without connection pooling
    • With connection pooling
    Inheritance Hierarchy

    System.Object
       System.MarshalByRefObject
          System.ComponentModel.Component
             System.Data.Common.DbConnection
                VistaDB.Provider.VistaDBConnection

    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