Using C#. I have a string dateTimeEnd.
dateTimeEnd
If the string is in right format, I wish to generate a DateTime and assign it to eventCustom.DateTimeEnd
DateTime
Now, I can't use DateTime?, I am using DBNull.Value for all data types. It works great.
DateTime?
DBNull.Value
eventCustom.DateTimeEnd = string.IsNullOrWhiteSpace(dateTimeEnd) ? DBNull.Value : DateTime.Parse(dateTimeEnd);