I am trying to enter null values into a database using
DateTime values. Where the string is empty I need to null
the value in the database.
if (dataAvailActual.ToString().Trim()!=string.Empty)
r.DATE_ACTUAL= System.DateTime.Parse(dataAvailActual);
else
r.PUBLICATION_DATE_ACTUAL= null;
The compiler gives me :
Cannot convert null to 'System.DateTime' because it is a
value type.
DBNull does not work either.