DateTime variables (along with all other value types) cannot be empty (unless you explicitly declare them nullable), because they must hold the value. (You now said that it is reset)
The required fix is ββquite simple - you can simply check the null value of the field in datarow and assign it a null DateTime value, if any, otherwise assign a value to the database of the type using the DataRow.Field<T> method:
this.FirstReceivedDate = dr["FirstReceivedDate"] == DBNull.Value ? (DateTime?)null : dr.Field<DateTime>("FirstReceivedDate");
Actually thinking about it, you should simply do the following to propagate a null value (untested):
this.FirstReceivedDate = dr.Field<DateTime?>("FirstReceivedDate");
As you stated that you want to get an empty string if the database value is null, then just when you show it, you can just check the DateTime value is null:
textBox1.Text = this.FirstReceivedDate == null ? "" : this.FirstReceivedDate.ToString();
source share