3
在vs2010中怎样在combobox中绑定数据
source link: https://blog.csdn.net/dmk877/article/details/23751309
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
C#高手群欢迎您的加入:207364916
SqlConnection Conn=.... string Sql= "select userid from admin"; DataSet Ds= new DataSet(); SqlDataAdapter Da= new SqlDataAdapter(Sql, Conn); Da.Fill(Ds, "admin"); comboBox1.DataSource = Ds.Tables["admin"];
//选中一列绑定到combobox中 comboBox1.DisplayMember = "userid";
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK