I have a datatable (treno1) containing 10 columns about group railway reservation. I need to know how many people loaded into a single car and how many people go to a single city.
I get a json reservation from a web.
With treno1
.Columns.Add("Partenza", System.Type.GetType("System.String"))
.Columns.Add("Arrivo", System.Type.GetType("System.String"))
.Columns.Add("PNR", System.Type.GetType("System.String"))
.Columns.Add("Classe", System.Type.GetType("System.String"))
.Columns.Add("Cognome", System.Type.GetType("System.String"))
.Columns.Add("Carrozza", System.Type.GetType("System.String"))
.Columns.Add("Posto", System.Type.GetType("System.String"))
.Columns.Add("Nome", System.Type.GetType("System.String"))
.Columns.Add("Treno", System.Type.GetType("System.String"))
.Columns.Add("ID prenotazione", System.Type.GetType("System.String"))
End With
For Each item As JProperty In data
item.CreateReader()
For Each msg As JObject In item.Values
treno1.Rows.Add(msg("departureLocationName"), msg("arrivalLocationName"), msg("pnrCode"), msg("serviceLevel"), msg("lastName"), msg("wagon"), msg("seat"), msg("firstName"), msg("transportMeanName"), msg("Id"))
Next
Next
I don't understand how to fill combobox1 with values from partenza and arrivo. These are columns with the departure station and arrival station.
I want combobox1 to be filled with all unique stations. An sql solution would be the best way but I can't understand how to make this query. column0 has roma,firenze,bologna;column1 has firenze,bologna,milano
at the end I want combobox1 with roma,firenze,bologna,milano (without duplicates)
thanks to all
What I have tried:
all example i read are with external db,i didn't underdstand how to make a query with a datatable (so an internal db).
which connection should i use?