public static void Insert(Object _Obj) { using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH)) { conn.RunInTransaction(() => { conn.Insert(_Obj); }); } }
public static void UpdateObject(Object _obj) { SQLiteConnection db; using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH)) { conn.RunInTransaction(() => { }); } }
public static async Task InsertAsync(Object _Obj) { await Task.Run(() => { using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH)) { conn.RunInTransaction(() => { conn.Insert(_Obj); }); } }); }
public void AddMobile(string macAddress, string name, DateTime lastConnectionDate, string lastState) { Debug.WriteLine("Add Mobile to DB : " + macAddress + " " + name + " " + lastConnectionDate.ToString() + " " + lastState); try { var s = new Mobile { MACAddress = macAddress, Name = name, LastConnectionDate = lastConnectionDate, LastState = lastState }; using (SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), this.DB_PATH)) { conn.RunInTransaction(() => { conn.Insert(s); }); } //conn.DeleteAll<Message> (); } catch { Debug.WriteLine("ERROR : Unable to add Message"); } }