This is by far not the best way but it would work...
Create three functions that will do the checks for you. I hope this helps
Code:
Public Overridable Function CheckThis(ByVal input As Object) As Object
Dim something As Object = Nothing
If isBool(input) = True Then
something = True
ElseIf isString(input) = "yes" Then
something = "Is String"
End If
Return something
End Function
Public Overridable Function isBool(ByVal input As Object) As Object
If TypeOf input Is Boolean Then
Return True
Else
Return False
End If
End Function
Public Overridable Function isString(ByVal input As Object) As Object
If TypeOf input Is String Then
Return "yes"
Else
Return "not string"
End If
End Function
Thanks for that what i'm aiming to do is create a easy SQL database class this class includes a query function this function splits the query string by ';' and exetues each query if the query is a "SELECT" query it will return a dataset, if it is a "INSERT INTO", "UPDATE", "DELETE" it will return an int of the number of rows inserted, updated or deleted. So this function will return only one object but it could one of two possible datatypes.. is it possible to have a function with 2 possible return datatypes?
My prefered ASP.NET coding language is C# so any help in this lanugage would be better.
Bookmarks