populate combox on windows mobile 5.0
I tr开发者_如何学Cy 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;
}
- Does the DataTable have data in it?
- Is the DataTable null?
- What values are you passing in for Value and DisplayText?
- Why aren't you value-checking your parameters before using them?
- Why aren't you using camelCase for your variables as is the recommended standard?
- Why are you passing in a reference to a reference type in your method, rather than just the object?
精彩评论