plz some one tell me the code for deleting a selected item from listview as well as from acsess database
i know the code for vb but for vb.net there is something wrong
Printable View
plz some one tell me the code for deleting a selected item from listview as well as from acsess database
i know the code for vb but for vb.net there is something wrong
Handling database connections and data drastically different then in VB6 so you are going to need to read up on ADO.NET tutorial to make a connection, update and read information from a database.
I believe there is a selected index property for a listview, so it might look something like ...
VB Code:
ListView1.Item.RemoveAt(ListView1.Item.SelectedIndex)
Also, if you have multiple selection allowed in your listview you can iterate through selected items collection:
VB Code:
For each item as ListViewItem in ListView.SelectedItems ListView.Items.Remove(item) Next
VB Code:
For Each lsvrow As ListViewItem In lvwdb.SelectedItems lvwdb.Items.Remove(lsvrow)