//Происходит при загрузке формы, настройка элементов управления private void AddServiceToRequest_Load(object sender, EventArgs e) { try { DBConnection.GetServices(); DBConnection.GetServicesGroups(); servicesGroup.DataSource = DBConnection.dtServicesGroups; servicesGroup.DisplayMember = "Наименование"; servicesGroup.ValueMember = "ID"; DBConnection.GetServicesInGroup(servicesGroup.SelectedValue.ToString()); service.DataSource = DBConnection.dtServicesInGroup; service.DisplayMember = "Название"; service.ValueMember = "id"; dateStart.Value = Convert.ToDateTime("2018-12-19"); dateEnd.Value = Convert.ToDateTime("2019-01-19"); calculate_cost_and_display(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }