vb.net - Listbox value pass in store in to variable using for loop -


i have 100 order number in listbox , number part or file name. need search file name using order number list box. example value list box

  • 456789-789464
  • 879746-123456

and file name 456789-789464-2013-11-23456-456.pdf.

logic finding file working cannot pass order number list box in variable. m using below code

   mooor string = ""     each item string in listbox1.items(1)        mooor &= item & vbcrlf    next 

with loop m getting msg ("unable cast object of type 'system.data.datarowview' type 'system.collections.ienumerable'")

your listbox1 bound datatable( or dataview) , items datarowview listbox1.items(1).row row(1) of table.

to find selected items need (wd: how determine items selected in listbox):

for x = 0 listbox1.listcount - 1    if listbox1.selected(x) = true              msg = msg & listbox1.list(x) & vbcrlf    end if next x 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -