title: How to get values from DataTable to combobox?
body: <p>I write winform the application in C#. It has a problem when using combobox with <code>DataTable</code>.
  I have <code>DataTable</code> like:</p>
  
  <pre><code>**privilege**       **username**       **password**
  
    admin                admin               8887abc
  
    user                 user1               abc123
  </code></pre>
  
  <p>And I load it to <code>combobox</code>. Only show privilege column, when the user clicks to admin or user, it auto load <strong>username</strong> and <strong>password</strong> corresponding with rows user click to <code>Textbox</code> user and password. I can't get the event when User click chose the privilege.</p>
  
  <p>My code like:</p>
  
  <pre><code>DataTable dt = new DataTable();
  
  cmbCategory.DisplayMember = "privilege";
  cmbCategory.ValueMember = "ID";
  cmbCategory.DataSource = dt;
  
  foreach(DataRow rows in dt.Rows)
  {
      txtUser.Text = rows["username"].ToString();
      txtPassword.Text = rows["password"].ToString();
  }
  
  cmbCategory.SelectedIndex = 0;
  </code></pre>
  
  <p>I load DataTable from excel file.
  This only all my code. 1 class to read data in Excel, load Excel data from path to DataTable.</p>