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

android - Invite new users for my app using app notifications facebook -

Need help in packaging app using TideSDK on Windows -

html - CSS: Combine Texture and Color -