Start New Discussion within our Software Development Community

I'm using the Visual Basic that comes with Visual Studio 2012 Utlimate, and everything I find online doesnt ever work. I am simply trying to make it to when a button is clicked the rows that are checked get deleted.

Do While TodaysTrans.SelectedItems.Count > 0

Mainly the code to delete rows, I have a form that has a ListView for the data to populate along with checkboxes.

Here's an an Example I was lookin at:

And what I have below wont let me use the ListView functions without adding a random 0 after each call?

    Private Sub RemoveTr_Click(sender As Object, e As EventArgs) Handles RemoveTr.Click
        Dim temp As String
        Do While (TodaysTrans.SelectedItems.Count > 0)
        temp = TodaysTrans.SelectedItems.Item(0).ToString(0)
        Control.MySQLConductor("ryan", "Doyle2233", "localhost", SetL, "DELETE From list WHERE Name= @one", temp)
        Control.MySQLListAdd("ryan", "Doyle2233", "localhost", SetL, "list", "Name", TodaysTrans)
    End Sub
End Class

You could try something like this:

        For Each lvi As ListViewItem In ListView1.SelectedItems
This article has been dead for over six months. Start a new discussion instead.