# Data-Binding

Learn about databinding in DateEdit. Read the topic to know more about DateEdit control for WinForms.

## Content



Binding a control with a data source gives you the ability to communicate and even update the underlying data through the control. Data binding in DateEdit helps to establish a connection between the user interface of the control and the data it displays.

![DateEdit control showing a particular date for OrderDate, an example for databinding.](https://cdn.mescius.io/document-site-files/images/1b33a1f1-17e3-4593-a233-97e8b8ff7610/images/datetditcontrol-bindingdata.png)

The DateEdit control can be bound to a data source using the [DataSource](/componentone/docs/win/online-calendar/) property of the [C1DropDownEditorBase](/componentone/docs/win/online-calendar/) class. You can specify the field to be bound to the control using the [DataMember](/componentone/docs/win/online-calendar/) property.

```csharp
// Create a datasource
dt = new DataTable();
string command = "SELECT * from invoices";
OleDbDataAdapter da = new OleDbDataAdapter(command,GetConnectionString());
da.Fill(dt);
bSource = new BindingSource();
bSource.DataSource = dt;
// Bind the DateEdit control to datasource
dateEdit.DataSource = bSource;
dateEdit.DataMember = "OrderDate";
```