和ASP.NET不一样,在winform中绑定ComboBox,除了要设置DataTable作为DataSource(DataTable.DefaultView也可以),还要明确这个ComboBox的DisplayMember和ValueMember两个数据,两个数据制定DataTable的列名即可,例如:
CodecmbCompanyLocationQueue.DataSource = dsOut.Tables[0].DefaultView;
cmbCompanyLocationQueue.DisplayMember = TableInfo.MS_GENERAL_FIELD.KEY_VALUE;
cmbCompanyLocationQueue.ValueMember = TableInfo.MS_GENERAL_FIELD.KEY_INDEX;
转载于:https://www.cnblogs.com/lx0831/archive/2009/06/07/1498295.html