Hello I have an One variable DateTime reg_date and One Textbox txt_reg_date.Now I want to store textbox value in reg_date variable. when textbox pass null value that time check if textbox=null then in variable store null value but that is not work properly...
DateTime reg_date;
reg_date= txt_reg_date.Text != string.Empty ? (DateTime?)Convert.ToDateTime( txt_reg_date.Text).Date : null;
but this is not working that display error.....