protected void Page_Load(object sender, EventArgs e)
{
// Loading data from the database to the webpage load
if (!IsPostBack)
{
//DayPilotCalendar1.DataSource = dbgetevents(DayPilotCalendar1.StartDate, DayPilotCalendar1.EndDate);
//DayPilotCalendar1.DataBind();
DayPilotMonth1.DataSource = dbgetevents_monthcal(DayPilotMonth1.StartDate);
DayPilotMonth1.DataBind();
}
}
protected DataTable dbgetevents_monthcal(DateTime startdate)
{
String Con = @"……”;
SqlConnection conn = new SqlConnection(Con);
conn.Open();
DataTable dt = new DataTable();
string select_cmd = "select * from sample_event order by cast(start as datetime)";
SqlDataAdapter da = new SqlDataAdapter(select_cmd, Con);
da.Fill(dt);
return dt;
}
DB table:
recital 2016-05-18 14:30:00.000 2016-05-18 15:30:00.000