views:

45

answers:

1

Hi,

I try populate combobox in windows mobile 5.0 pocket pc but i have this error:

Value does not fall within the expected range.

the datatable return from dataset on the webservice:

the method is:

public void loadComboBox(ref ComboBox ComboBoxGen, string DisplayText, string Value,DataTable dt)
{
    ComboBoxGen.DataSource = dt;
    ComboBoxGen.DisplayMember = DisplayText;
    ComboBoxGen.ValueMember = Value;
}
A: 
  1. Does the DataTable have data in it?
  2. Is the DataTable null?
  3. What values are you passing in for Value and DisplayText?
  4. Why aren't you value-checking your parameters before using them?
  5. Why aren't you using camelCase for your variables as is the recommended standard?
  6. Why are you passing in a reference to a reference type in your method, rather than just the object?
ctacke