M
Michel Racicot
When I do the following piece of code, it seems that it's illegal ton
typecast a string into a generic result:
Private Function GetTypeName(Of t)(ByVal FieldName As String) As t
Dim MyResult As t
If TypeOf MyResult Is String Then
MyResult = CType("Test", t)
Else
' Some other stuff
End If
Return MyResult
End Function
What can I do to solve the issue?
typecast a string into a generic result:
Private Function GetTypeName(Of t)(ByVal FieldName As String) As t
Dim MyResult As t
If TypeOf MyResult Is String Then
MyResult = CType("Test", t)
Else
' Some other stuff
End If
Return MyResult
End Function
What can I do to solve the issue?