if (objChildFees.childid != null)
{
objChildFees.classstudentid = 0;
objChildFees.classid = Convert.ToInt16(ddlClass.SelectedValue);
objChildFees.centerid = Convert.ToInt32(Session[CommonVariables.gCentreId].ToString());
objChildFees.roomno = 1;
objChildFees.startdate = Convert.ToDateTime(txtStartDate.Text.ToString());
objChildFees.enddate = Convert.ToDateTime(txtEndDate.Text.ToString());
objChildFees.newfees = Convert.ToDecimal(txtfeesamt.Text.ToString());
objChildFees.feestype = chkFeesPay.Checked == true ? 1 : 2;
objChildFees.childdaystype = chkfulltime.Checked == true ? 1 : 2;
objChildFees.feepermonthforsubsidized = 0;
objChildFees.feepermonthforpartime = 0;
objChildFees.feepermonthforparttimesubsidized = 0;
objChildFees.activestatus = true;
objChildFees.withdrawaldate = Convert.ToDateTime(txtwtdate.Text);
}
How to add null withdrawal date in this code I am facing the error: String was not recognized as a valid DateTime
IFormatProvider. Or use theDateTime.ParseExactmethod with the exact format specified.