title: InvalidArgument=Value of '0' is not valid for 'SelectedIndex'. Parameter name: SelectedIndex
body: <p>I am getting the above error when i am trying this code. I tried giving <a href="http://msdn.microsoft.com/en-us/library/h5e30exc.aspx" rel="noreferrer"><strong>just my code</strong></a> but no use. (It was default)<br></p>
  
  <p><a href="http://ideone.com/OnpgJ" rel="noreferrer"><strong>Here is my XML file</strong></a> </p>
  
  <p>The error is in <code>cmbProduct_SelectedIndexChanged</code> event.</p>
  
  <pre><code>        cmbProduct --&gt; combobox
          cmbBrand   --&gt; combobox
  </code></pre>
  
  <p><strong>Global</strong></p>
  
  <pre><code>        DataSet dsUpdate = new DataSet();
  </code></pre>
  
  <p><strong>Form_load</strong></p>
  
  <pre><code>        dsUpdate.ReadXml(@"...\..\stock.xml");
          cmbProduct.DataSource = dsUpdate.Tables[0]
              .DefaultView.ToTable(true, "productname");//.DefaultView;
          cmbProduct.DisplayMember = "productname";
          cmbProduct.SelectedIndex = 0;
  </code></pre>
  
  <p><strong>cmbProduct_SelectedIndexChanged</strong></p>
  
  <pre><code>        cmbBrand.Items.Clear();
          foreach (DataRow Row in dsUpdate.Tables[0].Select("productname='" + cmbProduct.Text + "'"))
          {
              //cmbBrand.SelectedIndex = i;
              cmbBrand.Items.Add(Row["brandname"].ToString());
              //i++;
          } 
          cmbBrand.SelectedIndex = 0; /*ERROR*/  
  </code></pre>
  
  <p>Please help
  <br>Thanks in Advance.</p>