G
Guest
Hi,
The code below generates a compile error on line 3 (dim d...)
Dim o As Object = "1900-01-01"
Dim s As String = TryCast(o, String)
Dim d As DateTime = TryCast(o, DateTime)
The error is : TryCast operand must be reference type, but 'Date' is a value
type.
How can I resolve this?
The second line of code does not generate a compile error at all.
Thanks.
Leo Leys
The code below generates a compile error on line 3 (dim d...)
Dim o As Object = "1900-01-01"
Dim s As String = TryCast(o, String)
Dim d As DateTime = TryCast(o, DateTime)
The error is : TryCast operand must be reference type, but 'Date' is a value
type.
How can I resolve this?
The second line of code does not generate a compile error at all.
Thanks.
Leo Leys