# Binding to a Data Source

This tutorial will show how to bind the Telerik Accordion component to an **AccessDataSource**:

1. Locate the "Nwind.mdb" file that appears in the "Live Demos\App_Data" sub-folder of the folder where you installed RadControls "for ASP.NET Ajax".

2. Drag this file ("Northwind.mdf") to the "App_Data" folder in the Solution Explorer for your project:![Nwind MDB](https://www.telerik.com/products/aspnet-ajax/documentation/assets/e0e2ad73bf1ab304c562a64f22ce0a58/panelbar_nwindmdb.png)

3. Add the following connection string in the web config file under the connection string section:![Connection String](https://www.telerik.com/products/aspnet-ajax/documentation/assets/e95143928b72d370ddffc29cc3e2fe5b/panelbar_connection_string.png)

4. Drag a **RadPanelBar** component from the toolbox onto your Web page. The **RadPanelBar** [Smart Tag](https://www.telerik.com/products/aspnet-ajax/documentation/controls/panelbar/design-time/smart-tag) should appear automatically:![PanelBar Tasks](https://www.telerik.com/products/aspnet-ajax/documentation/assets/938871678878587c9209804456961755/panelbar_gettingstarted1.png)

5. In the **RadPanelBar** Smart Tag, use the **Skin** drop-down to change the [skin](https://www.telerik.com/products/aspnet-ajax/documentation/controls/panelbar/appearance-and-styling/skins) for the **RadPanelBar** to "Vista":![Vista Skin](https://www.telerik.com/products/aspnet-ajax/documentation/assets/e6dbfeff84680f8168dd4ff5fe1c74f8/panelbar_skinvista.png)

6. Still in the Smart Tag, open the **Choose Data Source** drop-down and select **New Data Source**:
   ![New Data Source](https://www.telerik.com/products/aspnet-ajax/documentation/assets/ae6f6c247a18fea57f2538936d55327c/panelbar_newdatasource.png)

7. The Data Source Configuration Wizard appears. In the Select a DataSource Type screen, specify an **SqlDataSource** and click **OK.**![Choose A DataSourcecType](https://www.telerik.com/products/aspnet-ajax/documentation/assets/7472041a91f3db113b3e374d01e8ab5f/panelbar_chooseadatasourcetype.png)

8. In the **Choose your Data Connection** screen, click the **Browse** button, and select the "NorthwindConnectionString". Then choose **Next** to continue:
   ![Choose A Database](https://www.telerik.com/products/aspnet-ajax/documentation/assets/721d1dfc5303713b26477dfa7e29f3b0/panelbar_chooseadatabase.png)

9. In the **Configure the Select Statement** screen, choose **Specify columns from a table or view**.

10. In the **Name** drop-down, select the "Employees" table.

11. In the **Columns** panel, Select the "EmployeeID", "FirstName", and "ReportsTo" fields. Then choose **Next** to continue:![Configure Select](https://www.telerik.com/products/aspnet-ajax/documentation/assets/0cb271a0cb11e050f1634df418707623/panelbar_configureselect.png)

12. Click the **Test Query** button to see the data. Then click **Finish** to exit the Configure Data Source Wizard:![Query Test](https://www.telerik.com/products/aspnet-ajax/documentation/assets/c9f239052649a89c1f53168a9da08092/panelbar_testquery.png)

13. In the Properties pane for the **RadPanelBar** component,

    * Set the **DataFieldId** property to "EmployeeID".

    * Set the **DataFieldParentId** property to "ReportsTo".

    * Set the **DataTextField** property to "FirstName":

    ![Data Fields](https://www.telerik.com/products/aspnet-ajax/documentation/assets/b9f78a32e0d75caf779f9f5090150ba1/panelbar_datafields.png)

14. Run the application. The panel bar has a single root level item (for the one record with a null value in the "ReportsTo" field). When you expand this item, you can see level 1 items for every record that had Andrew's ID in the "ReportsTo" field. You can expand the item labelled "Steven" to see the level 2 items for records that had Steven's ID in the "ReportsTo" field:

![Bound PanelBar](https://www.telerik.com/products/aspnet-ajax/documentation/assets/e5b5f662337896709024114dae50965f/panelbar_bound.png)

## See Also

* [Data Binding Overview](https://www.telerik.com/products/aspnet-ajax/documentation/controls/panelbar/data-binding/overview)

* [Getting Started Overview](https://www.telerik.com/products/aspnet-ajax/documentation/controls/panelbar/getting-started/overview)
