System.ArgumentException: Object of type ‘System.Int64‘ cannot be converted to type ‘System.Int32‘

Object of type 'System.Int64' cannot be converted to type 'System.Int32'.!

最近在写SQLite数据库,然后主键的类型是INTEGER,如果直接用int来获取,会报错,System.ArgumentException: Object of type ‘System.Int64’ cannot be converted to type ‘System.Int32’。

解决方法:把Id改为long类型就可以
在这里插入图片描述
此教程为SQLite踩过的那些坑,记录以免其他兄弟踩

猜你喜欢

转载自blog.csdn.net/weixin_45375968/article/details/125413479