Failed to convert from type [null] to type [int] for value 'null';

报错截图:

原因:

基本数据类型不能赋值为null,而数据库中有的字段值为null。

解决方法:

把数据类型改为包装类,如int -> integer;

猜你喜欢

转载自blog.csdn.net/sgx5666666/article/details/103737537