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
Try using:
if (string.IsNullOrWhiteSpace(InsertDate.Text)) { cmd1.Parameters["@InsertDate"].Value = getDate; } else { cmd1.Parameters["@InsertDate"].Value = InsertDate.Text; }