'Declaration Public ReadOnly Property DynamicConnections As ConnectionCollection
public ConnectionCollection DynamicConnections {get;}
'Declaration Public ReadOnly Property DynamicConnections As ConnectionCollection
public ConnectionCollection DynamicConnections {get;}
By default, if C1DataSet.DynamicConnections is empty, data fetch and update for this data set uses the connections specified in the schema.
Add a connection object for each connection you want to change at run time for this data set. Usually, you will add a copy of a schema connection object(s) using C1.Data.SchemaObjects.Connection.Clone. Alternatively, you can create new connection objects from scratch, for example, new C1.Data.SchemaObjects.C1OleDbConnection(). Adding an existing connection object from schema to DynamicConnections throws an exception. This prevents changes unintentionally affecting other data sets attached to the same schema.
Having added a connection object, set its properties as desired. Usually, only the C1.Data.SchemaObjects.Connection.ConnectionString needs to be changed in connection objects obtained with C1.Data.SchemaObjects.Connection.Clone. If you created a new connection object, without using C1.Data.SchemaObjects.Connection.Clone, set its C1.Data.SchemaObjects.Connection.Name property to the name of the schema connection you want to modify.
When the data set performs a fetch or update operation while its DynamicConnections collection is not empty, it first looks for connection properties in DynamicConnection, and only then, if not found, in the schema. If DynamicConnections contains a connection with the same C1.Data.SchemaObjects.Connection.Name as the schema connection, that DynamicConnections element is used instead of the schema connection.
C1DataSet Class
C1DataSet Members
Database Connections