c# - Displaying 2 columns in one combobox -


i have employee table. want combobox present employee number , city.

sqlcommand cmd = new sqlcommand(); connection c = new connection(); cmd.commandtext = "select employeenumber, city tblemployee";  sqldataadapter adp = new sqldataadapter(cmd); dataset ds = new dataset(); adp.fill(ds, "employee");  combobox1.datasource = ds; 

that's got far, can me that?

you can add format event combobox, , in compose whatever want show:

private void _combobox1_format(object sender, listcontrolconverteventargs e) {     var x = (datefiltertype)e.listitem;     e.value = /* insert string concatenation stuff here... */; } 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -