hi all, here my problem is i'm preety new to vb.net programming. but have a little knowledge in vb6 programming. Say, when i press the 'edit' button a listview is shown, filled with records('empcode' field from empdetail) from a access table, say 'empdetail'. now if i doubleclick on a particuler record in the listview, then the listview will disappear and the records will be displayed in the textboxes. exactly what we do in vb6, the coding follows,cn is the connection to the db.
private sub listview1_dblclick() for i=1 to listview1.listitems.count if listview1.listitems(i).selected=true then dim rs as new adodb.recordset rs.cursorlocation=aduseclient rs.open "select * from empdetail where empcode='" & listview1.selecteditem & _ "'",cn if rs.recordcount>0 then text1.text=rs!empcode text2.text=rs!empname text3.text=rs!empaddress text4.text=rs!empdesignation listview1.visible=false text1.setfocus rs.close exit for else rs.close msgbox("......",vbokonly,"") end if end if next end sub
now i want to do exactly the same thing with vb.net, please give me the sample coding, because i know the logic but not familier with vb.net syntax.now if i click on the listview, it's being hung. any help is appricieted, thank u again
Edited 6 Years Ago by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).