context.SP_INSERT_DATA(MY_CHECKBOX.Checked == true ? Convert.ToDateTime(Textbox.Text) : (DateTime?)null , CustomerID);
Datetime Nullable value c# winforms
题
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.
解决方案
不隶属于 StackOverflow