Hi,
I am trying to grab data from a list box and split it up into its different parts and print out a message with those distinct parts all using linq.
But Im having a problem getting it tor work. This seems to work when I use a text file, but I cant seem to get the same concept to work with a list box.. When I run the program and click the appropriate button , it just hangs...
code:
Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click
Dim tape() As String = lstBoxTotals.SelectedItem
Dim query = From line In tape
Let data = line.Split(","c)
Let pname = data(0)
Let price = CDbl(data(1))
Select pname, price
For Each item In query
MessageBox.Show(item.pname)
MessageBox.Show(item.price)
Next
end sub
I am trying to grab data from a list box and split it up into its different parts and print out a message with those distinct parts all using linq.
But Im having a problem getting it tor work. This seems to work when I use a text file, but I cant seem to get the same concept to work with a list box.. When I run the program and click the appropriate button , it just hangs...
code:
Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click
Dim tape() As String = lstBoxTotals.SelectedItem
Dim query = From line In tape
Let data = line.Split(","c)
Let pname = data(0)
Let price = CDbl(data(1))
Select pname, price
For Each item In query
MessageBox.Show(item.pname)
MessageBox.Show(item.price)
Next
end sub