Hi folks,
I have seen many people read the message and probably my message was not clear.
My program has a calendar. Every time i enter an event date and a description of what's in the event to my table called Schedule, i want to see a highlight of the date in the calendar which is taken from the eventDate in the table Schedule. So every time a preson click on that date in the calendar he should see what the event is about.
Here is the whole code that i have used to make this happened:
Imports system.data
------------------------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As_ System.EventArgs) Handles Me.Load
If CalSchedule.SelectedDate = DateTime.MinValue Then
CalSchedule.SelectedDate = CalSchedule.TodaysDate
End If
End Sub
----------------------------------------------------
Private schedule As New DataView()
----------------------------------------------------
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As_ System.EventArgs) Handles Me.PreRender
schedule = CType(srcSchedule.Select_(DataSourceSelectArgument s.Empty), DataView) schedule.Sort = "entryDate"
End Sub
----------------------------------------------------
Protected Sub CalSchedule_DayRender(ByVal sender As Object,_ ByVal e As DayRenderEventArgs) Handles CalSchedule.DayRender_
If schedule.FindRows(e.Day.Date).Length > 0 Then
e.Cell.BackColor = System.Drawing.Color.Yellow
End If
End Sub
the problem in the above code is in bold. whenever i run the program an error message comes up and says:"Object reference not set to an instance of an object."
Can anyone knows what's the problem?
I hope this is very clear now and thank you very much for your help.
|