Does anyone have an idea why this works:
if (_item.Created == DateTime.MinValue)
{
ListSqlParam.Add(new SqlParameter("@TransactionCreated", DBNull.Value));
}
else
{
ListSqlParam.Add(new SqlParameter("@TransactionCreated", _item.Created));
}
but not this:
ListSqlParam.Add(new SqlParameter("@TransactionCreated",((_item.Created == DateTime.MinValue) ? DBNull.Value : _item.Created)));
DBNull.Valueisn't the same type as_item.Created.