c# - Getting the value and items in checkListBox -


i writing windows forms application has checklistbox. have databinded checklistbox value connected sql db. want write loop loop through list of checked items , value (not index). wondering there way combobox.selectedvalue?

foreach(var item in checklistbox.checkeditems){      //get value of      string query = select * employeeid '"+checklistbox.selectedvalue+"'  } 

you can try this:

foreach(object item in checklistbox.checkeditems) {      datarowview dt = item datarowview;      string str = dt["namehere"];      // code } 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -