Public Class frmCities

  Private Sub frmCities_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the 'MegacitiesDataSet.Cities' table. You can move, or remove it, as needed.
    Me.CitiesTableAdapter.Fill(Me.MegacitiesDataSet.Cities)
    Dim query = From city In MegacitiesDataSet.Cities
    Order By city.pop2010 Descending
    Select city.name
    lstCities.DataSource = query.ToList
  End Sub
  
  Private Sub lstCities_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstCities.SelectedIndexChanged
    Dim query = From city In MegacitiesDataSet.Cities
    Where city.name = lstCities.Text
    Select city.country, city.pop2010, city.pop2015
    txtCountry.Text = query.First.country
    txtPop2010.Text = FormatNumber(query.First.pop2010, 1)
    txtPop2015.Text = FormatNumber(query.First.pop2015, 1)
  End Sub

End Class
