Hello guys,
I have a Calendar control that I am working on. I am having problems with the appointment portion of it. Everytime you click on a time slot and type, it adds an appintment. Here is the code I use to add the appointment.
Appointment m_Appointment = newAppointment();
m_Appointment.StartDate = m_Date;
m_Appointment.EndDate = enddate;
m_Appointment.Title = "test";
m_Appointments.Add(m_Appointment);
Right now I have the appointments saved to a database that I have entered. The only problem is that after the program closes it doesnt save the appointments but they are in the database.
Is there a way to get the appointments at the start of the program?
I was thinking about getting the number of records int he database and put it in the interger "records" and then do a for loop to to add the appointments until the end of the records is complete. something like this.
for (int i = 0; i < records; i++)
{
Appointment m_Appointment = newAppointment();
m_Appointment.StartDate = m_Date;
m_Appointment.EndDate = enddate;
m_Appointment.Title = "test";
m_Appointments.Add(m_Appointment);
}
This will add them back to the form on start but how do I specify what StartDate, EndDate and Title are for each iteration through the records? I am kinda new to SQL.