Unable to cast object of type 'System.Int32' to type 'System.String'.
Posted djd66
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unable to cast object of type 'System.Int32' to type 'System.String'.相关的知识,希望对你有一定的参考价值。
关键错误点Unable to cast object of type \'System.Int32\' to type \'System.String\'.提示是无法将“System.Int32”的对象强制转换为“System.String”。于是我就找了所有使用Int的地方,终于发现
/// <summary> /// ID /// </summary> [Key] [StringLength(20)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public override int ID { get; set; }
在一个基类中有个Int类型的ID,不小心加上了StringLength属性。int类型是不能添加StringLength属性的,去掉之后就可以正常访问了。
以上是关于Unable to cast object of type 'System.Int32' to type 'System.String'.的主要内容,如果未能解决你的问题,请参考以下文章
Unable to cast object of type 'System.Int32' to type 'System.String'.
解决:open3d中Unable to cast Python instance to C++ type (compile in debug mode for details)
ORA-04031: Unable To Allocate 32 Bytes Of Shared Memory
Unable to locate value meta plugin of type (id)
unable to retrieve the list of the adapters 是啥意思?
错误:selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of