SqlConnection Conn
=
....
// 初始化,comboBox1绑定客户表
string Sql = " select customerName from customer " ;
DataSet Ds = new DataSet();
SqlDataAdapter Da = new SqlDataAdapter(Sql, Conn);
Da.Fill(Ds, " customer " );
comboBox1.DataSource = Ds.Tables[ " customer " ];
comboBox1.DisplayMember = " customerName " ;
// 初始化,comboBox1绑定客户表
string Sql = " select customerName from customer " ;
DataSet Ds = new DataSet();
SqlDataAdapter Da = new SqlDataAdapter(Sql, Conn);
Da.Fill(Ds, " customer " );
comboBox1.DataSource = Ds.Tables[ " customer " ];
comboBox1.DisplayMember = " customerName " ;