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
Post a Comment