In this article I will explain with an example, how to bind (populate) ComboBox with XML in Windows Forms (WinForms) Application using C# and VB.Net.
XML File
Following is the XML consisting of records of Customers.
<?xml version="1.0" standalone="yes"?>
        <Name>John Hammond</Name>
        <Country>United States</Country>
        <Name>Mudassar Khan</Name>
        <Name>Suzanne Mathews</Name>
        <Name>Robert Schidner</Name>
Form Design
The following Form consists of a ComboBox control and a Button. The Button has been assigned a Click event handler.
Populate ComboBox with XML in Windows Forms using C# and VB.Net
You will need to import the following namespace.
using System.IO;
Imports System.IO
Bind (Populate) ComboBox from XML data
Inside the Form Load event handler, the contents of the XML file are read into the DataSet using the ReadXml function which accepts the path of the XML file.
Then, the records are copied into the DataTable and a new row is inserted in First position which will act as the Default (Blank) item and the DataTable is set as DataSource for the ComboBox.
Finally, the DisplayMember and ValueMember are set with Name and CustomerId columns respectively.
private void Form1_Load(object sender, EventArgs e)
    using (DataSet ds = new DataSet())
        //Populate the DataTable.
        DataTable dt = ds.Tables["Customer"];
        //Insert the Default Item to DataTable.
        DataRow row = dt.NewRow();
        row[0] = 0;
        row[1] = "Please select";
        dt.Rows.InsertAt(row, 0);
        //Assign DataTable as DataSource.
        cbCustomers.DataSource = dt;
        cbCustomers.DisplayMember = "Name";
        cbCustomers.ValueMember = "CustomerId";
Private Sub Form1_Load(sender As Object, e AsEventArgs) Handles MyBase.Load
    Using ds As DataSet = New DataSet()
        'Populate the DataTable.
        Dim dt As DataTable = ds.Tables("Customer")
        'Insert the Default Item to DataTable.
        Dim row As DataRow = dt.NewRow()
        row(0) = 0
        row(1) = "Please select"
        dt.Rows.InsertAt(row, 0)
        'Assign DataTable as DataSource.
        cbCustomers.DataSource = dt
        cbCustomers.DisplayMember = "Name"
        cbCustomers.ValueMember = "CustomerId"
    End Using
End Sub
Fetching the selected Text and Value of ComboBox
When the Submit Button is clicked, the selected Text and Value of the ComboBox is fetched and displayed using MessageBox.
private void btnSubmit_Click(object sender, EventArgs e)
    string message = "Name: " + cbCustomers.Text;
    message += Environment.NewLine;
    message += "CustomerId: " + cbCustomers.SelectedValue;
Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Click
    Dim message As String = "Name: " & cbCustomers.Text
    message += Environment.NewLine
    message += "CustomerId: " & cbCustomers.SelectedValue
End Sub
Populate ComboBox with XML in Windows Forms using C# and VB.Net