Good afternoon everyone.
Please, I need your help.
I'm trying to write / update a Birth field of type DateTime, but this field will not always be filled, due to the business rule sometimes it will be null.
The base used is the Access mdb format.
At the time of recording / updating I can not, see how I'm doing.:
Example:
public DateTime? Nascimento { get; set; }
cmdInsercao.Parameters.AddWithValue("@NASCIMENTO", Cli.Nascimento);
I tried this:
cmdInsercao.Parameters.AddWithValue("@NASCIMENTO", Cli.Nascimento == null ? (object)DBNull.Value : Cli.Nascimento);
and nothing ....
DBNull.Value
did not roll either ..
Someone has a solution
Thank you