Combobox SelectedValue显示System.Data.DataRowView甚至转换为String

时间:2015-10-14 05:48:47

标签: c#

我在组合框控件中选择了一个项目并且associatename的值显示为null时出现错误。

private void cmbAssociateName_SelectionChangeCommitted(object sender, EventArgs e)
{
    ComboBox c = (ComboBox)sender;
    object associatename = c.SelectedText;
    DataTable dtAssociateID = objMainModuleBO.GetAssociateIDByName(associatename);
    Utilities.BindDataSource(cmbAssociateID, dtAssociateID, MSTAssociateMasterTO.ASSOCIATEID, null);

}

0 个答案:

没有答案