MaxPayne

MaxPayne

  • NA
  • 18
  • 18k

re populate the combobox

Jul 30 2012 4:54 AM
I am trying to pass the values from the selected row  from other to the other form on the combobox 
 onFormload the highlited code is working fine

  cboBuUnit.SelectedValue = iDestBuID;
    cboBuUnit.ValueMember = Convert.ToString(iDestBuID);

then my goal is to load new values to the combobox the i can be able to save it to database
 after the reset button then you must refresh the combobox with new values


  cboBuUnit.DataSource = dt;
  cboBuUnit.DisplayMember = "name";
  cboBuUnit.ValueMember = "bu_id";

the problem is when i try to save the values to database always return zero  with the code below
int.TryParse(cmBuUnit.ValueMember.ToString(), out iDestBu);



Answers (6)