C
C#3y ago
bg_666666

✅ create a nullable datetime array

hi all, how do we create a nullable datetime array?
5 Replies
bg_666666
bg_666666OP3y ago
i tried to initialize a nullable datetime to a variable that is result.Value = new DateTime[] { myDateVal } but result.Value is a nullable DateTime[] type
hiyosilver
hiyosilver3y ago
Put a ? after the type you want to be nullable.
bg_666666
bg_666666OP3y ago
like this ? result.Value = new DateTime?[] { myDateVal }
Akseli
Akseli3y ago
yes
bg_666666
bg_666666OP3y ago
okay thank you 🙏

Did you find this page helpful?