Harold Sota Harold Sota - 4 months ago 27
Vb.net Question

Types comparison in VB.NET

How i can compare type data type in VB.NET?
My code:

Private Function Equal(ByVal parameter As String, ByVal paramenterName As String, ByVal dataType As Type) As String

If dataType = String Then
return 1;
End If

End Function


Any ideas?

Answer
If dataType = GetType(String) Then
    return 1;
End If
Comments