J
JimLad
This is just an example of the crux of the problem:
CType(CObj("11/09/2009"), Date)
Returns date object as expected.
CType(CObj("11/09/2009"), Nullable(of Date))
In QuickWatch returns the string.
At runtime crashes out with invalid Cast.
Can someone explain the different behaviour to me please? I don't see
why one works and one doesn't.
Also assuming I have a gridview returning IOrderedDictionary, how do I
convert blanks strings to nothing and non-blank string to date? Do I
have to resort to IIF? Given that Nullable(of Date) can't cope with
different base types cast as objects I guess I'll have to...
In the case above I had a function returning a string, but when
'Nothing' was returned it got converted to an empty string. Then I
tried returning the string date or nothing in an object, but that
still didn't work.
I'm probably being a bit stupid. Apoplogies if the answer is simple...
James
CType(CObj("11/09/2009"), Date)
Returns date object as expected.
CType(CObj("11/09/2009"), Nullable(of Date))
In QuickWatch returns the string.
At runtime crashes out with invalid Cast.
Can someone explain the different behaviour to me please? I don't see
why one works and one doesn't.
Also assuming I have a gridview returning IOrderedDictionary, how do I
convert blanks strings to nothing and non-blank string to date? Do I
have to resort to IIF? Given that Nullable(of Date) can't cope with
different base types cast as objects I guess I'll have to...
In the case above I had a function returning a string, but when
'Nothing' was returned it got converted to an empty string. Then I
tried returning the string date or nothing in an object, but that
still didn't work.
I'm probably being a bit stupid. Apoplogies if the answer is simple...
James