|
-
Nov 20th, 2006, 11:01 PM
#1
Thread Starter
Addicted Member
[RESOLVED] list 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
Using VB.NET 2003/.NET 1.1
If you found a post useful then please Rate it!
Please mark you thread resolved using the Thread Tools above
-
Nov 21st, 2006, 12:37 AM
#2
Fanatic Member
Re: list view
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)
-
Nov 21st, 2006, 01:38 AM
#3
Lively Member
Re: list view
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
-
Nov 21st, 2006, 04:39 AM
#4
Thread Starter
Addicted Member
Re: list view
VB Code:
For Each lsvrow As ListViewItem In lvwdb.SelectedItems
lvwdb.Items.Remove(lsvrow)
Using VB.NET 2003/.NET 1.1
If you found a post useful then please Rate it!
Please mark you thread resolved using the Thread Tools above
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|