I am filling the rows of a datatable in a for loop and want to handle the type conversion for the different columns dynamically. The problem I was running into is the cType function won't accept a type object as an object. Here is the code I was trying
Dim Val As Object
Dim ColDataType As Type = ThisTable.Columns(CPI.PropName).DataType
Val = CPI.EvaluatedVal(CType(objCont.Value.Obj, SldWorks.Feature), InDoc:=objCont.Value.ParentDoc)
ThisRow.Item(CPI.PropName) = CType(Val, coldatatype)'<-------Compiler error Type 'coldatatype' is not defined.
What is one to do?