Monday, 15 July 2013

Listview vb.net -



Listview vb.net -

i have listview in form. everytime user enters item code, listed in listview. want when user entered cash, , after scheme computes change, want deduct items bought in database record. of now, have code:

while tmp <= listview1.items.count while <= ds.tables("iteminfo").rows.count = listview1.items(tmp - 1).subitems(0).text qt = listview1.items(tmp - 1).subitems(3).text if = ds.tables("iteminfo").rows(a).item("itemcode") 'msgbox(ds.tables("iteminfo").rows(a).item("itemcode")) ct = ds.tables("iteminfo").rows(a).item("qty") nw = convert.toint32(ct) - convert.toint32(qt) msgbox(nw) con1.open() mycommand = new sqlcommand("update iteminfo set qty='" & nw & "' itemcode='" & & "'", con1) mycommand.executenonquery() con1.close() 'exit 'else end if = + 1 loop tmp = tmp + 1 loop

but problem didn't deduct items within listview. first line in listview whos beingness deducted in database. dont know if problem in looping or what. thankyou in advance :)

you can utilize foreach read items listview

for each listviewitem in listview1.items next

vb.net listview

No comments:

Post a Comment