有谁知道为什么会这样:
if (_item.Created == DateTime.MinValue)
{
ListSqlParam.Add(new SqlParameter("@TransactionCreated", DBNull.Value));
}
else
{
ListSqlParam.Add(new SqlParameter("@TransactionCreated", _item.Created));
}
但不是这个:
ListSqlParam.Add(new SqlParameter("@TransactionCreated",((_item.Created == DateTime.MinValue) ? DBNull.Value : _item.Created)));