I have a table in which there are some datetime type columns. I use a stored procedure to insert values into the table. In the stored procedure I have variables that accept null
if (//some condition) { cmd.Parameters.AddWithValue("@dateofBirth", txtdob.text); } else { cmd.Parameters.AddWithValue("@dateofBirth", DBNull.Value); }