public static void InsertBookmark(BookmarkExt item) { try { var connection = new SQLiteConnection(Conn); connection.Open(); string sql = string.Format("insert into bookmark (title, hadithid, pageno, chapterno, hadithno) values ('{0}',{1},{2},{3},{4})", item.Title, item.HadithId, item.PageNo, item.ChapterNo, item.HadithNo); SQLiteCommand command = new SQLiteCommand(sql, connection); command.ExecuteNonQuery(); connection.Close(); } catch { throw; } }
public static void DeleteBookmark(BookmarkExt item) { try { var connection = new SQLiteConnection(Conn); connection.Open(); string sql = string.Format("delete from bookmark where idx = {0}", item.idx); SQLiteCommand command = new SQLiteCommand(sql, connection); command.ExecuteNonQuery(); connection.Close(); } catch { throw; } }