iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello Crosslight Support,
I have a question about Crosslihgt SQLite and primary keys with auto increment.
If the primary key as an integer, why do I have to set it to -100 (as in the data sqlite sample) in order to work properly? Is this by design or any other reason?
Setting it to -1 works as well. But leaving it to 0 just saves the first entity and throws an exception when saving the second entity. Other ORMs like Entity Framework handle a 0 value without any problem.
Thanks for clarifying.
Thomas
... why do I have to set it to -100 (as in the data sqlite sample) in order to work properly? Is this by design or any other reason?Setting it to -1 works as well. ...
... why do I have to set it to -100 (as in the data sqlite sample) in order to work properly? Is this by design or any other reason?
Setting it to -1 works as well. ...
Yes, you are correct. Setting it to -1 will works as well. To work with auto increment primary keys, we can use any negative number (less than 0). It is recommended to use -1.
We'll have the sample updated by applying default ItemId to -1.
Thank you very much for the feedback.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname