How to convert a TypeCode to an actual type?

后端 未结 5 1719
一向
一向 2021-02-19 03:14

In the code below I get colType which is a code number for the type. But how would I convert that number into the actual type? Thx!!

for (int j = 0;         


        
5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-19 04:02

    The exact answer to the question in the OP (using schoetbi's hint) would be:

    public static Type GetType(TypeCode code)
        {         
            return Type.GetType("System." + Enum.GetName(typeof(TypeCode), code));
        }
    

提交回复
热议问题