c# - Update sqlite database using sqlite-net in windows store app -
i want update database using linq syntax. have updating in sqlite database this
var dbpath = path.combine(windows.storage.applicationdata.current.localfolder.path, "users.db"); using (var db = new sqlite.sqliteconnection(dbpath)) { db.update(new booking() { }); db.commit(); db.dispose(); db.close(); } i want know update syntax syntax simple example.thanks
you're not attempting update; you're trying insert.
take here , you'll see can call instead.
var booking = db.table<booking>() .where(x => x.name == "jack's bbq joint") .firstordefault(); // change in object db.update(booking); from docs:
/// updates of columns of table using specified object /// except primary key. /// object required have primary key. an alternative solution go lowlevel , create queries yourself:
db.execute("update bookings set ...");
Comments
Post a Comment