I'm trying to update a SQLite
record's boolean
"Large" attribute in my code-behind. I'm using the sqlite-net-pcl
Nuget package in Xamarin.Forms
shared project.
I've figured out how to pass my record through to my method, but I can't get the attribute to update.
public async void PutBack(object sender, ItemTappedEventArgs e)
{
var selectedListItem = e.Item as ListItem;
selectedListItem.Large = false
...
}
When I run this I don't get any errors, but nothing happens. What's the correct syntax to update a record? It's weirdly hard to find documentation on this subject.
I assume you had create dependency
in platform. So just open connection to SQLite
according to your path. Like what you had to do when query it back. Like this,
var platform = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid();
var conn = new SQLiteConnection(platform, path);
then use that conn
to run an update on that object after you edit.
conn.Update(selectedListItem);