Example to update data using sqlite.net-pcl

Hi,

I see the document shows an example of how to insert data using SQLite.net-pcl, but how do I update data?

The insert example seems simple, but how do I update?

        db.Insert(
            new TableAccount 
            {
                fieldKey = "TEST",
                fieldValue = "hello world!"
            }
        );

Answers

  • SilverSurferSilverSurfer USMember ✭✭

    Nevermind, I figured it out. You basically need to set the column as primary key and it will automatically know which row to update. Pretty slick!

        db.Update(
            new TableAccount 
            {
                fieldKey = "TEST",
                fieldValue = "hello world!"
            }
        );
    
Sign In or Register to comment.