AJAX Calendar/Scheduling Controls
Hi,
I am using daypilot lite 2.3. I managed to connect the daypilot to my database but all events are rendering on one single day, todays current date. How can I render the events based their own specified days?
here is how my binding and query looks like...also my DataStartField and DataEndField are bound to data with the date and time are supplied.
protected DataTable GetEventData() { SqlConnection myConnection = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"]); myConnection.Open(); SqlTransaction myTrans = myConnection.BeginTransaction(); SqlCommand myCommand = new SqlCommand(); myCommand.Connection = myConnection; myCommand.Transaction = myTrans; myCommand.CommandText = "Select * From appointment"; myCommand.ExecuteNonQuery(); myTrans.Commit(); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(myCommand); da.Fill(ds); myConnection.Close(); Session["EventData"] = ds.Tables[0]; return (DataTable)Session["EventData"]; }
"Appointment Table"
Appt_day application_type appt_IDendDate Jul 3 2007 9:30AM employment 1Jul 3 2007 9:45AM
<DayPilot:DayPilotCalendar id=DayPilotCalendar1 runat="server" Width="500" NonBusinessHours="HideIfPossible" TimeFormat="Clock12Hours" PkColumnName="appt_ID" NameColumnName="last_name" EndColumnName="endDate" BeginColumnName="appt_time"HourHeight="80" BusinessEndsHour="12" >
if (!IsPostBack) { DayPilotCalendar1.DataSource = GetEventData();}
No, that does not change anything
Thanks dan for all your help. Not sure what i did, but seems to work now!
DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java