|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
How to: Update a Data Source with Data from a Host Control
The features in this topic are available only if you have the required applications installed.
For more information, see.
The host controls that enable simple data binding require that you use themethod for each control to send updated data to the in-memory data source. If the end user navigates away from the host control, WriteValue is not called automatically.
To send changes that have been made in memory using WriteValue to the backend data source, call
TableAdapter. If the end user changes a record and does not navigate away from the control, then your code must call WriteValue before calling Update.
You do not need to call WriteValue when you do complex data binding using thecontrol. The ListObject control automatically sends changes to the data source without requiring additional code.
For more information about host controls, see.
To update a dataset from a BindingSource
Call WriteValue for the control. This example assumes that you have acontrol named
NamedRange1with its property bound to a field in a data source.