C # obtain the corresponding type (type) based on the string)
Public Static Type gettypebystring ( String Type)
{
Switch (Type. tolower ())
{
Case " Bool " :
Return Type. GetType ( " System. Boolean " , True , True );
Case " Byte " :
Return Type. GetType ( " System. byte " , True , True );
Case " Sbyte " :
Return Type. GetType ( " System. sbyte " , True , True );
Case " Char " :
Return Type. GetType ( " System. Char " , True , True );
Case " Decimal " :
Return Type. GetType ( " System. Decimal " , True , True );
Case " Double " :
Return Type. GetType ( " System. Double " , True , True );
Case " Float " :
Return Type. GetType ( " System. Single " , True , True );
Case " Int " :
Return Type. GetType ( " System. int32 " , True , True );
Case " Uint " :
Return Type. GetType ( " System. uint32 " , True , True );
Case " Long " :
Return Type. GetType ( " System. int64 " , True , True );
Case " Ulong " :
Return Type. GetType ( " System. uint64 " , True , True );
Case " Object " :
Return Type. GetType ( " System. Object " , True , True );
Case " Short " :
Return Type. GetType ( " System. int16 " , True , True );
Case " Ushort " :
Return Type. GetType ( " System. uint16 " , True , True );
Case " String " :
Return Type. GetType ( " System. String " , True , True );
Case " Date " :
Case " Datetime " :
Return Type. GetType ( " System. datetime " , True , True );
Case " Guid " :
Return Type. GetType ( " System. guid " , True ,True );
Default :
Return Type. GetType (type, True , True );
}
}