DataSource=;\.Open();sqlcon=newSqlConnection(",sqlcon)SqlConnectionsqlcon;);SqlDataAdaptersqlada;sqlcon.DisplayMember="sqlada=newSqlDataAdapter(str;stringstr="很简单的一个绑定;listBox1..Fill(a).;press;goodsname1".希望能帮到你;;InitialCatalog=HQZPOSDB;.DefaultView;DataSeta=newDataSet();sqlada.DataSource=a;UserID=sa.Tables[0];Password=zenii"goodsname1".ValueMember="selectgoodsname1fromgoods";listBox1;listBox1.\
SqlConnection sqlcon; SqlDataAdapter sqlada; sqlcon = new SqlConnection("Data Source=.\\press;Initial Catalog=HQZPOSDB;User ID=sa;Password=zenii"); sqlcon.Open(); string str = "select goodsname1 from goods"; sqlada = new SqlDataAdapter(str, sqlcon); DataSet a = new DataSet(); sqlada.Fill(a); listBox1.DisplayMember = "goodsname1"; listBox1.ValueMember = "goodsname1"; listBox1.DataSource = a.Tables[0].DefaultView;很简单的一个绑定 ..希望能帮到你..
SqlConnection sqlcon; SqlDataAdapter sqlada; sqlcon = new SqlConnection("Data Source=.\\press;Initial Catalog=HQZPOSDB;User ID=sa;Password=zenii"); sqlcon.Open(); string str = "select goodsname1 from goods"; sqlada = new SqlDataAdapter(str, sqlcon); DataSet a = new DataSet(); sqlada.Fill(a); listBox1.DisplayMember = "goodsname1"; listBox1.ValueMember = "goodsname1"; listBox1.DataSource = a.Tables[0].DefaultView;