DateTime? myDate = form.dteStartDate; string sqlFormattedDate = myDate.Value.ToString("yyyy-MM-dd HH:mm:ss");