w*s 发帖数: 7227 | 1 Hi in database i have Table1,
it has 2 fields, prevDay, currDay.
sometime the fields are null in database, not filled yet.
in the code i want to check if null or not 1st,
if ((DateTime)Table1.prevDay != (DateTime?)null)
when i run it, it says Nullable objects must have a value.
what's the correct way ?
also what's the difference between DateTime and DateTime?
thanks ! | l*s 发帖数: 783 | 2 .HasValue
【在 w*s 的大作中提到】 : Hi in database i have Table1, : it has 2 fields, prevDay, currDay. : sometime the fields are null in database, not filled yet. : in the code i want to check if null or not 1st, : if ((DateTime)Table1.prevDay != (DateTime?)null) : when i run it, it says Nullable objects must have a value. : what's the correct way ? : also what's the difference between DateTime and DateTime? : thanks !
| w*s 发帖数: 7227 | 3 worked, thanks ! :)
【在 l*s 的大作中提到】 : .HasValue
|
|