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

In This Topic
    ConnectionString Property
    In This Topic
    Gets or sets a connection string to a database which should be used as a data source, using syntax and conventions of connection string definition peculiar to ADO.NET Data Provider denoted by the ConnectionProvider property.
    Syntax
    'Declaration
     
    Public Property ConnectionString As System.String
    public System.string ConnectionString {get; set;}
    Remarks
    By setting this property to a non-empty value you can define a database denoted by the specified connection string as a data source for this C1DataViewSet. In this case C1DataViewSet retrieve database schema information and creates internal DataSet object with DataTable, DataRelation, DataColumn objects and constraints which reflect the schema of specified database, see C1DataViewSet Data Sources for details. This DataSet object is accessible via the DataSet property. If at this moment C1DataViewSet is connected to an instance of DataSet via the DataSet property, the usage of those Dataset as a data source is stopped.

    In case where the SqlClient provider is used to connect to a server, it's possible to retrieve schema and data from multiple catalogs, including catalogs on linked servers, by specifying the catalog names in the ConnectionCatalogs collection property.

    The specified connection string must follow syntax and conventions stated by an ADO.NET Data Provider specified in the ConnectionProvider property. When this property is set to non-empty value, C1DataViewSet creates a DbConnection derived object corresponding to the specified Data Provider and assigns its ConnectionString property with the provided value. This connection object is accessible via the Connection property.

    To stop using the specified database as C1DataViewSet data source set this property value to an empty string.

    See Also