How to assign Null value to datetime variable using nullable
I am getting a value from the textbox (I select a date)
but, may be sometimes user not select any value to the datetime textbox
in that cases i compare with null
i do like , but it gives me error
DateTime? ScheduleDate = txtScheduleDate.Text;
if (ScheduleDate.HasValue)
{
ScheduleDate = Convert.ToDateTime(txtScheduleDate.Text);
}