display two columns combobox c#
con.Open();
OleDbCommand cmd = new OleDbCommand("Select emaployeeFirstName + ' ' + employeeLastName as name from Employee", con);
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
comboBoxLabour.DisplayMember = "name";
comboBoxLabour.ValueMember = "name";
comboBoxLabour.DataSource = dt;
con.Close();
The WinForms ComboBox Control is able to display multiple columns in C# code
ReplyDelete