in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

How can I set the rowid column data type from 64bit integer to 32bit integer ?

Last post 01-10-2010 6:51 PM by hjf1223. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-17-2009 4:35 AM

    How can I set the rowid column data type from 64bit integer to 32bit integer ?

    Hi I use entity framework to isolate database. Now I have developed on MSSQL, and want to change the database to SQLite. On the identity column, I want to use SQLite rowid, but the data type of rowid is 64-bit. I cannot map it to my entity type, because the column in the entity type is 32bit integer, the exception message is : " The 'ColumnId' property on 'Cms_Column' could not be set to a 'Int64' value. You must set this property to a non-null value of type 'Int32'. " . Is there anyone want to tell me how can I resolve it ? Is there anywhere to set the data type of rowid?
  • 12-17-2009 7:56 AM In reply to

    Re: How can I set the rowid column data type from 64bit integer to 32bit integer ?

     I found this post :http://marc.info/?l=sqlite-users&m=113874997713990&w=2

    If you compile with -DSQLITE_32BIT_ROWID=1, then rowids are
    limited to 32 bits.

     But I don't konw how to do it in System.Data.SQLite ?

  • 12-17-2009 9:42 PM In reply to

    Re: How can I set the rowid column data type from 64bit integer to 32bit integer ?

    I get more about it. The default entity framework will be ok .But when I use EF cache provider will cause the error. http://code.msdn.microsoft.com/EFProviderWrappers
  • 01-10-2010 12:47 PM In reply to

    • magik
    • Top 500 Contributor
    • Joined on 01-09-2010
    • Posts 5

    Re: How can I set the rowid column data type from 64bit integer to 32bit integer ?

     (I'm only intermediate with SQLite and the provider, but I'll try an answer..)

     Datatypes in SQLite are dynamic, so you can't set it explicitly to a magnitude.

    More information here: http://www.sqlite.org/datatype3.html

    My guess is that with the default value it'll be good.

    Or you may need to set it to: <Property Name="param_id" Type="Int64" Nullable="false" />  in the <edmx:ConceptualModels> section.

  • 01-10-2010 6:51 PM In reply to

    Re: How can I set the rowid column data type from 64bit integer to 32bit integer ?

     Thanks for reply. I had resoved the problem. It cause by the cache provider.

Page 1 of 1 (5 items)
Powered by Community Server (Commercial Edition), by Telligent Systems