protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { DataSet ds = GetData(); //string link = "<a href='ScheduleDetails.aspx?scheduleID="; string s = e.Day.Date.ToShortDateString(); e.Cell.Text = e.Day.Date.Day.ToString() + "<BR>"; LiteralControl l = new LiteralControl(); l.Text = e.Day.Date.Day.ToString() + "<BR>"; e.Cell.Controls.Add(l); foreach (DataRow row in ds.Tables[0].Rows) { string Transaction_date = Convert.ToDateTime(row["transaction_date"]).ToShortDateString(); if (Transaction_date.Equals(s)) { LinkButton lb = new LinkButton(); lb.Text = "IN:" + row["actual_time_in"] as String + "<BR>" + row["actual_time_out"] as String + row["status"] as String + "</a>" + "<BR>"; e.Cell.Controls.Add(lb); } }
private DataSet GetData() { SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["conString"].ConnectionString); SqlDataAdapter ad = new SqlDataAdapter("CalendarAttendance", myConnection); DataSet ds = new DataSet(); ad.Fill(ds); return ds; }
AS BEGIN SET NOCOUNT ON; SELECT actual_time_in=@actual_time_in, actual_time_out=@actual_time_out, status=@status FROM tblschedule where Employeeid = @Employeeid END