The line where it determines whether it's autoincrement or not is in (): column.AutoIncrement = Convert.ToBoolean(row) & GetDbType(row.ToString()) = DbType.Int64 This seems to mean that I can't set the ID column - subsonic's ActiveHelper.GetInsertCommand() ignores it, since it thinks it's auto-generated. However, when I use SubSonic's sonic.exe to auto-generate my DAL, the primary key column is set to AutoIncrement = true. This should be no problem: I'll simply provide values when I create records in this table. In my application my ID values are generated from a remote database, so I don't want to auto-generate them in sqlite. The problem is that SubSonic thinks they are always auto incremented. So sqlite thinks these columns are sometimes auto incremented (ie just when NULL values are provided). If you declare a column of a table to be INTEGER PRIMARY KEY, then whenever you insert a NULL into that column of the table, the NULL is automatically converted into an integer which is one greater than the largest value of that column over all other rows in the table, or 1 if the table is empty. I'm using SubSonic 2.2 and sqlite and have encountered a problem when dealing with tables with an INTEGER PRIMARY KEY column that isn't AUTOINCREMENT.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |