public void StoreShapeFileItems(List <ShapefileItem> items) { lock (this) { if (_dbcon != null) { using (var db = new NPoco.Database(_dbcon.Connection, NPoco.DatabaseType.SQLite)) { db.BeginTransaction(); try { db.Execute("delete from ShapeFileItemV2"); foreach (var s in items) { db.Insert("ShapeFileItemV2", null, s); } db.CompleteTransaction(); } catch { db.AbortTransaction(); } } } } }
public void DeleteScriptItem(string name) { lock (this) { if (_dbcon != null) { using (var db = new NPoco.Database(_dbcon.Connection, NPoco.DatabaseType.SQLite)) { db.Execute("delete from Scripts where Name=@0", name); } } } }
public void DeleteGeocacheCollectionItem(int colid, string code) { lock (this) { if (_dbcon != null) { using (var db = new NPoco.Database(_dbcon.Connection, NPoco.DatabaseType.SQLite)) { db.Execute("delete from GeocacheCollectionItem where CollectionID = @0 and GeocacheCode = @1", colid, code); } } } }
public void DeleteGeocacheCollection(int id) { lock (this) { if (_dbcon != null) { using (var db = new NPoco.Database(_dbcon.Connection, NPoco.DatabaseType.SQLite)) { db.Execute("delete from GeocacheCollection where CollectionID = @0", id); } } } }
public static void ClearTables(NPoco.Database db) { db.Execute("DELETE FROM persons"); db.Execute("UPDATE SQLITE_SEQUENCE SET SEQ=0 WHERE NAME='persons'"); db.Execute("DELETE FROM marriages"); db.Execute("UPDATE SQLITE_SEQUENCE SET SEQ=0 WHERE NAME='marriages'"); db.Execute("DELETE FROM marriage_sons"); db.Execute("UPDATE SQLITE_SEQUENCE SET SEQ=0 WHERE NAME='marriage_sons'"); }
public int Execute([JetBrains.Annotations.NotNull] string sql) { lock (Dblock) { return(_database.Execute(sql)); } }