private void LoadData() { FlightsService service = Service.getInstanse().flightService; DataTable AllFlightsTable; if (service.GetAllFlights(out AllFlightsTable)) { IdTickets.Clear(); foreach (DataRow row in AllFlightsTable.Rows) { IdTickets.Add(Convert.ToInt32(row[0])); } AllFlightsTable.PrimaryKey = null; AllFlightsTable.Columns.RemoveAt(0); GridView.DataSource = AllFlightsTable; GridView.DataBind(); } DropDownListDeparture.Items.Clear(); DataTable FlightCityTable; if (service.GetFlightsCities(out FlightCityTable)) { foreach (DataRow row in FlightCityTable.Rows) { DropDownListDeparture.Items.Add((string)row[0]); } } OnChangeDepartureCity(null, EventArgs.Empty); UpdateEnableAddTicket(); }