当从类别组合框中选择类别时尝试加载品牌组合框时,我遇到了问题。我收到一个错误:
输入字符串的格式不正确。
我的代码:
private void CategoryComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
BrandTB brnd = new BrandTB();
brndobj = new BrandBAL();
BrandComboBox.DataSource = brndobj.LoadBrandCombobox(brnd).Tables[0];
brnd.CategoryID = Convert.ToInt32(CategoryComboBox.SelectedValue.ToString());
BrandComboBox.DisplayMember = "Brand";
BrandComboBox.ValueMember = "ID";
}