
BindingSource Component as an Intermediary
The BindingSource component acts as the data source for some or all of the controls on the form. In Visual Studio, the BindingSource can be bound to a control by means of the DataBindings property, which is accessible from the Properties window. For more information, see How to: Bind Windows Forms Controls with the BindingSource Component Using the Designer.
You can bind the BindingSource component to both simple data sources, like a single property of an object or a basic collection like ArrayList, and complex data sources, like a database table. The BindingSource component acts as an intermediary that provides binding and currency management services. At design time or run time, you can bind a BindingSource component to a complex data source by setting its DataSource and DataMember properties to the database and table, respectively. The following illustration demonstrates where the BindingSource component fits into the existing data-binding architecture.
.gif)
Note: |
|---|
At design time, some actions, like dragging a database table from a data window onto a blank form, will create the
BindingSource component, bind it to the underlying data source, and add data-aware controls all in one operation. For more information, see Displaying Data Overview.
|