假设combobox绑定的列表为DataSet2的ListTable表(含有ListID, ListName字段),需要绑定的记录字段为DataSet1的Table1表的ListID字段
combobox.DataSource = dataset2.Tables["ListTable"];
combobox.DisplayMember = "ListName";
combobox.ValueMember = "ListID";
combobox.DataBindings.Add("SelectedValue", dataset1, "Table1.ListID");
2.*****************************************************************
//dt为数据表,ID,Name为dt的两个字段:
comboBox1.DataSource = dt ;
comboBox1.ValueMember ="ID";
comboBox1.DisplayMember ="Name";
3.******************************************************************
SqlConnection con = new SqlConnection("server=192.168.2.198;uid=sa;pwd=sa;database=northwind");
SqlCommand cmd = con.CreateCommand();
= "Select * from Customers where country='USA'";
SqlDataAdapter adp = new SqlDataAdapter();
adp.SelectCommand = cmd;
DataSet ds = new DataSet();
adp.Fill(ds, "Customers");
comboBox1.DataSource = ds.Tables["Customers"];
comboBox1.DisplayMember = "CompanyName";
comboBox1.ValueMember = "CompanyName";