# Databinding a control vb.net to a combobox

**URL:** <https://forums.thehomestack.io/t/databinding-a-control-vb-net-to-a-combobox/329>\
**Category:** vb.Net\
**Created:** [December 18, 2008, 9:16pm UTC](https://forums.thehomestack.io/t/databinding-a-control-vb-net-to-a-combobox/329 "2008-12-18T21:16:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forums.thehomestack.io/uploads/default/original/1X/161426793bc0d8bdf0d1a6692b3e44446861cc72.jpeg) [@system](https://forums.thehomestack.io/u/system)\
**Post date:** [December 18, 2008, 9:16pm UTC](https://forums.thehomestack.io/t/databinding-a-control-vb-net-to-a-combobox/329/1 "2008-12-18T21:16:57Z")

</div>

Here is a simple example:

```auto
yourComboBox.DataSource=yourDataSet.Tables("Ctype")
yourComboBox.DisplayMember="Ctype"
yourComboBox.ValueMember="ID"

```

then to retrieve the user selection:

```auto
int nID=yourComboBox.SelectedValue

```
