i am using vb.net i have a list box name LSTlocations..i can select multiple locations from that list box..i am fetching id of particular location to one list varibale..so i given code like this:
cnt = LSTlocations.SelectedItems.Count
Dim strname As String
If cnt > 0 Then
For i = 0 To cnt - 1
Dim locationanme As String = LSTlocations.SelectedItems(i).ToString
Dim locid As Integer = RecordID("Locid", "Location_tbl", "LocName", locationanme)
Dim list As New List(Of Integer)
list.Add(locid)
Next
End If
but i am not getting my all seclected locations id in my list varibale..how i can get all selected locations id from my listbox to list varable