Partager via


Bind Windows Forms controls to data in Visual Studio

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

You can display data to users of your application by binding data to Windows Forms. To create these data-bound controls, you can drag items from the Data Sources window onto the Windows Forms Designer in Visual Studio. This topic describes some of the most common tasks, tools, and classes involved in creating data-bound Windows Forms applications.

Data Source drag operation

For general information about how to create data-bound controls in Visual Studio, see Bind controls to data in Visual Studio. For more information about data binding in Windows Forms, see Windows Forms Data Binding.

In this section

BindingSource component

The BindingSource component serves two purposes. First, it provides a layer of abstraction when binding the controls on your form to data. Controls on the form are bound to the BindingSource component (instead of being bound directly to a data source).

Second, it can manage a collection of objects. Adding a type to the BindingSource creates a list of that type.

For more information about the BindingSource component, see:

BindingNavigator control

This component provides a user interface for navigating through data displayed by a Windows application. For more information, see BindingNavigator Control.

DataGridView control

To display and edit tabular data from many different kinds of data sources, use the DataGridView control. You can bind data to a DataGridView by using the DataSource property. For more information, see DataGridView Control Overview.

See Also

Bind controls to data in Visual Studio