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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -