c# - combobox items from the database -


in c# used combo box in form , wish obtain specific column table in database , contents of column added items in combo box. have declared way

string strcon, strqry; sqlconnection con; sqldataadapter da; dataset ds; sqlcommand comm;  den strcon= data source =" " initial catalog =" " use id =" " password=" "; con = new sqlconnection(strcon); strquery = select city cities; da = new sqladapter(strqry,con); ds = new dataset; da.fill(ds, " cities"); 

should put loop till items continue adding?

update:

i want entire column added items in check box. on click of check box, want entire column displayed respective item in check box.

combobox1.items.add(drcities.cells[0].value); combobox1.items.add(drcities.cells[1].value); 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -