I am still developing this function, but here is what I am intending it to do. This function will accept an Object, then try to determine its type. There are a specific set of types I am looking for: Integer, Boolean, Date, String. What I have so far is pretty privative, but it seems to be working so far:
Private Function DataType(ByVal entry As Object) As ValueType
Try
If IsNumeric(entry) Then
If Integer.Parse(entry) Then
Return ValueType.Number
End If
End If
Catch
End Try
Try
If Boolean.Parse(entry) Then
Return ValueType.Boolean
End If
Catch
End Try
Try
If Not Date.Parse(entry) = Nothing Then
Return ValueType.Date
End If
Catch
End Try
Return ValueType.Text
End Function