> Is my DirectCast needed in this case?
Not needed, but certainly acceptable. And not redundant.
The difference between CType and DirectCast is that CType will work as long
as there is a valid conversion defined for the expression and the object
type specified, whereas DirectCast will only work if the run-time types are
the same. For example:
Dim i As Integer = CType("23", Integer) 'Fine
Dim i As Integer = DirectCast("23", Integer) ' Exception
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...
hey all,
Private Property mEmployeeDataset() As DsHRLIBR24
Get
Return DirectCast(Session("oDs"), DsHRLIBR24)
End Get
Set(ByVal Value As DsHRLIBR24)
Session("oDs") = Value
End Set
End Property
Is my DirectCast needed in this case?
thanks,
rodchar