# Binding to a Database

The following tutorial demonstrates binding **RadTreeView** to an Access Data Source containing hierarchical data. The table contains columns for "ItemID", "ParentID" and "Name". "Name" is used to populate the text of each node while "ItemID" and "ParentID" describe the hierarchy. The screenshot below shows the appearance of the running example application.

> caption

![RadTreeView Getting Started](https://www.telerik.com/products/aspnet-ajax/documentation/assets/6f59e7202fc5e3c5615e260102e1f19e/treeview_gettingstarted01.png)

1. In a new AJAX-Enabled Web Application, drop a **RadTreeView** to the default form.

2. Locate the "Database.mdb" Access Data Base in the **RadControls for ASP.NET AJAX** suite version installation directory under *\Live Demos\App_Data*. The typical path would be similar to this one: *\Telerik\RadControls for ASPNET <current version>\Live Demos\App_Data\Database.mdb*

3. Drag the "Database.mdb" file to the project in the Solution Explorer.
   > caption
   ![RadTreeView Getting Started](https://www.telerik.com/products/aspnet-ajax/documentation/assets/4554e7d1e9493e834df214d4f75752be/treeview_gettingstarted02.png)

4. Open the [Smart Tag](https://www.telerik.com/products/aspnet-ajax/documentation/controls/treeview/design-time/smart-tag) and set the **Skin** to **Vista** from the drop down list. Then select **<New data source...>** from the **Choose Data Source** drop down list. *This step will display the Data Source Configuration Wizard.*
   > caption
   ![RadTreeView Getting Started](https://www.telerik.com/products/aspnet-ajax/documentation/assets/346807bc5a4e8d0ebaec362d26efc739/treeview_gettingstarted03.png)

5. In the Data Source Configuration Wizard, "Choose a Data Source Type" page, select the **Access Database** icon and click the **OK** button. *This step will display the Configure Data Source Wizard.*
   > caption
   ![RadTreeView Getting Started](https://www.telerik.com/products/aspnet-ajax/documentation/assets/131d661273a208668e4ce3ea558d432e/treeview_gettingstarted04.png)

6. In the "Choose a Database" page, Microsoft Access Data File text box enter "\~/Database.mdb". Click the **Next** button to continue.
   > caption
   ![RadTreeView Getting Started](https://www.telerik.com/products/aspnet-ajax/documentation/assets/adef6a436d499adbcfa558f026d93a53/treeview_gettingstarted05.png)

7. In the "Configure the Select Statement" page of the wizard, choose "Items" from the drop down list. Check the "ItemID", "Name" and ParentID columns. Click the **Next** button.
   > caption
   ![RadTreeView Getting Started](https://www.telerik.com/products/aspnet-ajax/documentation/assets/4fc502863a992be3d8492a44add26fbc/treeview_gettingstarted06.png)

8. In the "Test Query" page of the wizard, click the **Finish** button to close the wizard. The Access Data Source component will be created automatically and assigned to the **DataSourceID** property of **RadTreeView**

9. In the Properties Window for the **RadTreeView**:

10. Set the **DataFieldID** property to "ItemID".

11. Set the **DataFieldParentID** property to "ParentID".

12. Set the **DataTextField** property to "Name".
    > caption
    ![RadTreeView Getting Started](https://www.telerik.com/products/aspnet-ajax/documentation/assets/24e3e446ebc2f6eb3c8ec7d0b231373c/treeview_gettingstarted07.png)

13. Press **F5** to run the application.
