I encounter a problem: An object of type "System.Int64" cannot be converted to type "System.Int32" when starting the SubSonic.Examples.SimpleRepo database on the SQLite provider.
I like that the data type for the Category table column CategoryID is " integer ", and the "integer" in SQLite will be returned as Int64 , at the same time, the data type of the Category category in the int class category , the error is higher.
I checked the source code of SubSonic: \ SubSonic.Core \ SQLGeneration \ Schema \ SQLiteSchema.cs and found the following codes:
else if (column.IsPrimaryKey && column.DataType == DbType.Int32
|| column.IsPrimaryKey && column.DataType == DbType.Int16
|| column.IsPrimaryKey && column.DataType == DbType.Int64
)
sb.Append(" integer ");
Who can tell me the purpose for these codes? How to solve data type conversion error?
source
share