Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

SQLite primary key does not work

$
0
0

Hello! I have problem with primary key in PCL project. I'm using SQLite-net (1.4.118.0) library.
I forgot to add property with attributes PrimaryKey, AutoIncrement at the begining.
Later i added primary key but it does not work, but in Id column only "0" values.
It only works if i create new class with new name and PrimaryKey, AutoIncrement attributes.
How to recreate my table in Sqlite from the scratch with original class name?
Where is table metadata stored in Sqlite, how i can clean it?

public class ApproachViewModelNew
    {
        [SQLite.PrimaryKey, SQLite.AutoIncrement]
        public int Id { get; set; }
        public string ApproachName { get; set; }
    public string ApproachDescription { get; set; }
    }

Viewing all articles
Browse latest Browse all 77050

Trending Articles