Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
Clearing nullable datetime values
posted
Hallo, I think I'm missing something obvious here: I have a column in a grid that is of type (DateTime?). While I can set a value in a row via: selectedRow.Cells["DateCompleted"].Value = DateTime.Now; I cannot clear the value via: selectedRow.Cells["DateCompleted"].Value = null; Because null is not of type System.Nullable'(System.DateTime). I've tried DBNull's. What am I forgetting here? Indika
  • 469350
    Verified Answer
    Offline posted

    When you say you cannot set the value to null, what exactly do you mean? I beleive that setting the column to null should work.

    What happens when you do so?