Windows窗体C#中使用TableLayoutPanel和动

Windows窗体C#中使用TableLayoutPanel和动

本文介绍了在Windows窗体C#中使用TableLayoutPanel和动态Combobox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 connection.Open(); 
string query = select * from product_details ;
OleDbDataAdapter da = new OleDbDataAdapter(查询,连接);
DataSet ds = new DataSet();
da.Fill(ds, product_details);

combo1.DataSource = ds.Tables [ product_details];
combo1.DisplayMember = 条形码;
combo1.ValueMember = product_name;


combo2.DataSource = ds.Tables [ product_details];
combo2.DisplayMember = product_name;
combo2.ValueMember = 条形码;
解决方案

connection.Open();
string query = "select * from product_details";
OleDbDataAdapter da = new OleDbDataAdapter(query, connection);
DataSet ds = new DataSet();
da.Fill(ds, "product_details");

combo1.DataSource = ds.Tables["product_details"];
combo1.DisplayMember = "barcode";
combo1.ValueMember = "product_name";


combo2.DataSource = ds.Tables["product_details"];
combo2.DisplayMember = "product_name";
combo2.ValueMember = "barcode";
解决方案


这篇关于在Windows窗体C#中使用TableLayoutPanel和动态Combobox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 01:29