P
phoebe
Hi, Good Day!
I had a tableholiday that store startdate, enddate and holiday name.
Below is the coding to display the holiday name in asp:Calendar webcontrol
when a page is load. It manage to display a holiday which is only 1 day.
I need more as if the holiday are 2 or 3 days, how should i display it on
the calendar as my database store only the startdate and enddate for the
holiday.
Please help. Thanks in advanced.
rgds,
phoebe.
Sub cal_DayRender(ByVal sender As Object, ByVal e As DayRenderEventArgs)
Dim objDb As New SqlConnection(myConnectionString)
Dim objCom As New SqlCommand("select * from holiday where date1=@sdate",
objDb)
objCom.Parameters.Add("@sdate", e.Day.Date)
objDb.Open()
Dim objDr As SqlDataReader = objCom.ExecuteReader()
Do While objDr.Read()
e.Cell.Controls.Add(New LiteralControl("<br />" &
String.Format(objDr.GetString(0))))
Loop
objDb.Close()
End Sub
I had a tableholiday that store startdate, enddate and holiday name.
Below is the coding to display the holiday name in asp:Calendar webcontrol
when a page is load. It manage to display a holiday which is only 1 day.
I need more as if the holiday are 2 or 3 days, how should i display it on
the calendar as my database store only the startdate and enddate for the
holiday.
Please help. Thanks in advanced.
rgds,
phoebe.
Sub cal_DayRender(ByVal sender As Object, ByVal e As DayRenderEventArgs)
Dim objDb As New SqlConnection(myConnectionString)
Dim objCom As New SqlCommand("select * from holiday where date1=@sdate",
objDb)
objCom.Parameters.Add("@sdate", e.Day.Date)
objDb.Open()
Dim objDr As SqlDataReader = objCom.ExecuteReader()
Do While objDr.Read()
e.Cell.Controls.Add(New LiteralControl("<br />" &
String.Format(objDr.GetString(0))))
Loop
objDb.Close()
End Sub