This question already has an answer here:

I am trying to assign a simple string variable to a class attribute and it is throws exception saying. ERROR: Object reference not set to an instance of an object.

Is don't get it, what is wrong the values are there, but if i check them in isNull it returns false. Please help me understand this issue.

Code Snippet:

    private void SetData()
    {
        string time = tsMeeting.Hour + ":" + tsMeeting.Minute + ":" + tsMeeting.Second+" "+tsMeeting.AmPm;
        string date = calMeeting.SelectedDate.Year + "/" + calMeeting.SelectedDate.Month + "/" + calMeeting.SelectedDate.Day;

       // if (String.IsNullOrEmpty((date + " " + time).Trim()))
        //{
            meeting.MeetingTime = date + " " + time;
            meeting.Edit();
        //}
    }  

Related posts

Recent Viewed