this.comboBox1.DataSource = ds.Tables[0];
this.comboBox1.ValueMember = "GUI";
this.comboBox1.ValueMember = "GUI";
this.comboBox1.DisplayMember = "ZWM";
string userid = this.comboBox1.SelectedValue.ToString();这个是获取ID的代码
///
ArrayList mylist = new ArrayList();
mylist.Add (new DictionaryEntry ("1","坏"));
mylist.Add (new DictionaryEntry ("2","不好"));
mylist.Add (new DictionaryEntry ("3","一般"));
mylist.Add (new DictionaryEntry ("4","好"));
mylist.Add (new DictionaryEntry ("5","太好了"));
comboBox1.DataSource =mylist;
comboBox1.DisplayMember ="Key";
comboBox1.ValueMember ="Value";
本文演示了如何使用C#获取数据表中的ID,并利用这些ID创建ComboBox组件,提供了详细代码实现步骤。

2854

被折叠的 条评论
为什么被折叠?



