1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
Try
Dim one As New Toponyme("Chambery", "", "", "Rhône-Alpes", "France", "", "")
CommunesSource.Add("One", one)
Dim two As New Toponyme("Chambery", "", "", "Rhône-Alpes", "France", "", "")
CommunesSource.Add("Two", two)
Dim three As New Toponyme("Chambery", "", "", "Rhône", "France", "", "")
CommunesSource.Add("Three", three)
Dim four As New Toponyme("Chamb", "", "", "Rhône-Alpes", "France", "", "")
CommunesSource.Add("Four", four)
'For Each t In CommunesSource
' MsgBox(t.Value.sNom)
'Next
Dim sNomRég As String = "Rhône-Alpes"
Dim sNomTo As String = "Chambery"
Dim ToExtract = CommunesSource.Where(Function(f) f.Value.sNomRégion = sNomRég AndAlso f.Value.sNom = sNomTo)
For Each t In ToExtract
'Retourne l'index de chaque objet qui possède les critères de requête (sNomRég et sNomTo)
MsgBox(t.Key)
Next
Catch ex As Exception
MsgBox(ex.ToString)
End Try |
Partager