I've created table with column type INT8. When I try to execute select query using SQLiteCommand.ExecuteScalar(C#) it returns SByte instead of long.
Why?
I've created table with column type INT8. When I try to execute select query using SQLiteCommand.ExecuteScalar(C#) it returns SByte instead of long.
Why?
Part of data type mapping in System.Data.SQLite.dll source:
new SQLiteDbTypeMapping("INT8", DbType.SByte, false),
new SQLiteDbTypeMapping("INT16", DbType.Int16, false),
new SQLiteDbTypeMapping("INT32", DbType.Int32, false),
new SQLiteDbTypeMapping("INT64", DbType.Int64, false),
new SQLiteDbTypeMapping("INTEGER", DbType.Int64, true)
According to source code INT8 is System.SByte. In fact .Net API for SQLite allows to store INT64 values into INT8 field. This value can be read in two ways:
In my test I've stored value '129' into INT8 field. Then I tried to read this value.