Cannot implicitly convert 'string' to 'System.TypeCode'

前端 未结 2 1632
野性不改
野性不改 2021-01-29 00:31

Just wondering if anyone knows how to fix this error? I\'ve also used TypeCode. but still no luck. Thanks

case typeof(Nullable).ToString         


        
2条回答
  •  礼貌的吻别
    2021-01-29 01:06

    The type you use in the switch statement has to match the type in the case statements, where currently you're comparing a TypeCode to a string.

    The TypeCode enumeration only contains values for the primitive types, and all others will be TypeCode.Object. So you can't get a specific TypeCode for the Nullable type.

提交回复
热议问题