When i select from sqlite column of type 'int' I can cast to .net int but when I select from 'integer' column I cannot

后端 未结 3 441
独厮守ぢ
独厮守ぢ 2021-02-09 00:22

I\'m using System.Data.SQLite, selecting from a sqlite database table where a column has type \'integer\', and when I do something like this:

int x = (int)reade         


        
3条回答
  •  暖寄归人
    2021-02-09 00:39

    SQLite http://www.sqlite.org/datatype3.html INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.

    .NET http://msdn.microsoft.com/en-us/library/cs7y5x0x(VS.90).aspx int -2,147,483,648 .. 2,147,483,647

    So I would expect an overflow or out of range error for 'big' SQlite integer values.

提交回复
热议问题