课程清单
public class doc
{
public string NAME { get; set; }
public int CODE { get; set; }
public string ROOM { get; set; }
}
//另一个用于绑定的选项
Datatable dt = dt.Source
List<string> a = dt.AsEnumerable().Select(dr => dr["FIELD"].ToString()).ToList<string>();
listbox1.Items.AddRange(a);
var a = bill.GetDocs();//List source
DataSet ds = bill.GetDoctors();//Datasetsource
dlNAME.DataSource = a;
dlNAME.ValueMember = "ROOM";
dlNAME.DisplayMember = "NAME";
enter code here
//两个绑定源都在列表框中。
private void SelectedIndexChanged
{
txtbox1.Text = //What code should I put?
}