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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -