【发布时间】:2010-11-22 03:51:42
【问题描述】:
我遇到一个问题:基于 SQLite 提供程序运行 SubSonic.Examples.SimpleRepo 项目时,“System.Int64”类型的对象无法转换为“System.Int32”类型。 p>
我喜欢表Categories列CategoryID的数据类型是'integer',同时SQLite中的'integer'会返回为Int64 Class Category中CategoryID的数据类型为int,出现上述错误。
我查看了SubSonic的源码:\SubSonic.Core\SQLGeneration\Schema\SQLiteSchema.cs,发现如下代码:
else if (column.IsPrimaryKey && column.DataType == DbType.Int32
|| column.IsPrimaryKey && column.DataType == DbType.Int16
|| column.IsPrimaryKey && column.DataType == DbType.Int64
)
sb.Append(" integer ");
谁能告诉我这些代码的用途? 数据类型转换错误如何解决?
【问题讨论】:
标签: c# sqlite subsonic subsonic3