# Binding to DataTable

Binding to DataTable is quite easy with **RadChartView**. Once your table is created, you just need to set the needed members to the desired fields. In [this article](https://www.telerik.com/products/winforms/documentation/controls/chartview/populating-with-data/populating-with-data) , you can find the members needed for the different series types.

Here is a sample demonstrating how to bind а [LineSeries](https://www.telerik.com/products/winforms/documentation/controls/chartview/series-types/line):

## Binding to DataTable

```C#
DataTable table;

protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);

    table = new DataTable();
    table.Columns.Add("Value", typeof(double));
    table.Columns.Add("Name", typeof(string));
    table.Rows.Add(1, "John");
    table.Rows.Add(3, "Adam");
    table.Rows.Add(5, "Peter");
    table.Rows.Add(12, "Sam");
    table.Rows.Add(6, "Paul");

    LineSeries lineSeria = new LineSeries();
    radChartView1.Series.Add(lineSeria);

    lineSeria.ValueMember = "Value";
    lineSeria.CategoryMember = "Name";
    lineSeria.DataSource = table;
}
```

```VB.NET
    Private table As DataTable

    Protected Overrides Sub OnLoad(e As EventArgs)
        MyBase.OnLoad(e)

        table = New DataTable()
        table.Columns.Add("Value", GetType(Double))
        table.Columns.Add("Name", GetType(String))
        table.Rows.Add(1, "John")
        table.Rows.Add(3, "Adam")
        table.Rows.Add(5, "Peter")
        table.Rows.Add(12, "Sam")
        table.Rows.Add(6, "Paul")

        Dim lineSeria As New LineSeries()
        RadChartView1.Series.Add(lineSeria)

        lineSeria.ValueMember = "Value"
        lineSeria.CategoryMember = "Name"
        lineSeria.DataSource = table
    End Sub
```

> caption Figure 1: Binding to DataTable

![WinForms RadChartView Binding to DataTable](https://www.telerik.com/products/winforms/documentation/assets/be2d029508b3c874057ec873375c502e/chartview-databinding-binding-to-datatable001.png)

Adding, removing or modifying a record in the DataTable is automatically reflected in **RadChartView**:

> caption Figure 2: Modify Item

![WinForms RadChartView Modify Item](https://www.telerik.com/products/winforms/documentation/assets/912900235c8752fa15d9e5425b084065/chartview-databinding-binding-to-datatable002.png)

## See Also

* [Getting Started](https://www.telerik.com/products/winforms/documentation/controls/chartview/getting-started)
* [Binding to BindingList](https://www.telerik.com/products/winforms/documentation/controls/chartview/populating-with-data/binding-to-bindinglist)
