문제

I have checkbox and if checkbox checked is true , i want to insert textbox text as datetime(no problem here)However if checkbox checked is not true , i want to give null datetime value.

I don't know how can i give null datetime during inserting data ?

context.SP_INSERT_DATA(MY_CHECKBOX.Checked == true ? Convert.ToDateTime(Textbox.Text) : NULLABLE_value , CustomerID);

Any help will be appreciated.

Thanks.

도움이 되었습니까?

해결책

context.SP_INSERT_DATA(MY_CHECKBOX.Checked == true ? Convert.ToDateTime(Textbox.Text) : (DateTime?)null , CustomerID);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top