Z
zdrakec
Hello all:
I have a list of values from a database table, each of which is
identified by name and by type, thus:
ValueField TypeName
---------- --------
"Value1" "String"
"Value2" "Boolean"
"Value3" "Integer"
In the application, these values are being put into an array of
objects, thus:
Dim obj() as Object = {"Value1","Value2","Value3"}
I would like to perform a type conversion on each object in the array,
without using a Case statement to do so. However, if I try something
like:
Dim lType as Type = Type.GetType("String")
I am not then able to do:
obj(0) = CType(obj(0),lType)
since the CType function requires an actual type, and will not accept a
variable name.
Suggestions?
Thanks much,
zdrakec
I have a list of values from a database table, each of which is
identified by name and by type, thus:
ValueField TypeName
---------- --------
"Value1" "String"
"Value2" "Boolean"
"Value3" "Integer"
In the application, these values are being put into an array of
objects, thus:
Dim obj() as Object = {"Value1","Value2","Value3"}
I would like to perform a type conversion on each object in the array,
without using a Case statement to do so. However, if I try something
like:
Dim lType as Type = Type.GetType("String")
I am not then able to do:
obj(0) = CType(obj(0),lType)
since the CType function requires an actual type, and will not accept a
variable name.
Suggestions?
Thanks much,
zdrakec