/// <summary> /// Fills form with appointment data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void UpdateAppointmentForm_Load(object sender, EventArgs e) { //Display appointment ID lblappID.Text = appointmentID.ToString(); //Initialize customer and appointment table adapters custAdapter = new businessDataSetTableAdapters.CustomersTableAdapter(); appAdapter = new businessDataSetTableAdapters.AppointmentsTableAdapter(); //Load Data into fields on form //Declare appointment table businessDataSet.AppointmentsDataTable appointmentTable; //Fill table with appointment data appointmentTable = appAdapter.GetData(); //Declare appointment dataset row businessDataSet.AppointmentsRow row; //Set row equal to appointment with matching appointment ID row = appointmentTable.FindByAppointmentID(appointmentID); //Set fields to existing data txtCustID.Text = row.CustomerID.ToString(); cboAppReason.SelectedText = row.AppointmentReason.TrimEnd(); dtpDate.Value = row.Date.Date; dtpTime.Value = row.Date; }