public void setData(int tourid, SQLConnector scon) { sCon = scon; dS = new DataSet(); TourID = tourid; if (tourid >= 0) { lb_id.Text = "Tour-ID: " + tourid; } //load ship, route Data from Server sDA_routes = sCon.getShip_Route_List_sort(dS, null); sDA_ships = sCon.getShips_List(dS, null); sDA_tour = sCon.getShip_Tour(dS, "tour", null, tourid); //set Data to Form-Elements lBox_ship.DataSource = dS.Tables["ships"]; lBox_ship.DisplayMember = "name"; lBox_ship.ValueMember = "ShipID"; lBox_route.DataSource = dS.Tables["ship_routes"]; lBox_route.DisplayMember = "RouteName"; lBox_route.ValueMember = "RouteID"; if (dS.Tables["tour"].Rows.Count > 0) { lb_id.Text = "Tour-ID: " + dS.Tables["tour"].Rows[0]["ID"]; lBox_ship.SelectedValue = dS.Tables["tour"].Rows[0]["shipID"]; lBox_route.SelectedValue = dS.Tables["tour"].Rows[0]["routeID"]; dTP_sailingDate.Value = (DateTime)dS.Tables["tour"].Rows[0]["sailing_time"]; dTP_sailingTime.Value = (DateTime)dS.Tables["tour"].Rows[0]["sailing_time"]; dTP_returnDate.Value = (DateTime)dS.Tables["tour"].Rows[0]["return_time"]; dTP_returnTime.Value = (DateTime)dS.Tables["tour"].Rows[0]["return_time"]; nTB_tour_costs.Text = ((Decimal)dS.Tables["tour"].Rows[0]["tour_costs"]).ToString(); tB_name.Text = (string)dS.Tables["tour"].Rows[0]["name"]; } }