ComponentOne ADO.NET DataExtender
C1.C1DataExtender.2 Assembly / C1.C1DataExtender Namespace / C1DataViewSet Class / Connection Property

In This Topic
    Connection Property (C1DataViewSet)
    In This Topic
    Gets DbConnection object used to connect to database in the case when data source is defined by means of ConnectionString and ConnectionProvider properties. Allows you to set up data source via existing DbConnection derived component in run time.
    Syntax
    'Declaration
     
    Public Property Connection As System.Data.Common.DbConnection
    public System.Data.Common.DbConnection Connection {get; set;}
    Remarks
    This property is related to ConnectionString and ConnectionProvider properties, which allows you to denote data source via connection string, see C1DataViewSet Data Sources for details on this type of data source.

    If ConnectionString property set to a non empty value, C1DataViewSet creates a DbConnection derived object of the type corresponding to the value of the ConnectionProvider property, which is accessible via this property.

    This property can be set directly in run time to an instance of a DbConnection derived object denoting a desired database. In this case values of ConnectionString and ConnectionProvider are updated accordingly.

    See Also