Question : C# checking null value in datepicker with check box

Hi I have wrtten a global function as suggested by one of experts here which is as follows
public static object GetDateValue(DateTimePicker picker)
        {
            IFormatProvider format = System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat;

            return picker.Checked ? (object)picker.Value.ToString("dd/MM/yyyy", format) : DBNull.Value;
        }

Now from form, I tried the following but none works
banquethall.Effectivedateto = ValidateUI.GetDateValue(dateeffectivedateto) as DateTime?; - This returns null even if datepicker is checked

banquethall.Effectivedateto = ValidateUI.GetDateValue(dateeffectivedateto); - This says cannot convert souce type object to system.nulable(system.datetime)

banquethall.Effectivedateto = (DateTime?) ValidateUI.GetDateValue(dateeffectivedateto); - This also does not work

Request Help

Answer : C# checking null value in datepicker with check box

Is this steaming directly through the web? Try to reset Explorer in Tools - internet options - advanced - reset.
Random Solutions  
 
programming4us programming4us