locked
Storing a collection in the local storage

    Question

  • Hi,

    I'd like to store a collection in the local storage. SQLite would be an overkill to store a single table and XML/serialization would require to load and save the entire file even if I wanted to update a single item. An alternative would be to keep each items in individual XML files (or any other type of files). 

    I'm wondering if there is any other recommended mechanism available for Windows Store apps that would allow me to store a collection of items in the local storage.

    Thanks,

    Leszek


    Wiki: wbswiki.com
    Website: www.wisenheimerbrainstorm.com

    Friday, May 30, 2014 12:52 PM

Answers

  • It really depends on the data and the app's needs. For small data you may be able to use app settings.

    Otherwise there isn't much between saving and restoring a complete file and using a database like SQLite to manage access to the file. You could write your own file handling code to randomly access the fire contents, but in most cases doing that yourself is more complicated than it is worth.

    • Marked as answer by ata6502 Friday, May 30, 2014 3:04 PM
    Friday, May 30, 2014 2:42 PM
    Owner

All replies

  • It really depends on the data and the app's needs. For small data you may be able to use app settings.

    Otherwise there isn't much between saving and restoring a complete file and using a database like SQLite to manage access to the file. You could write your own file handling code to randomly access the fire contents, but in most cases doing that yourself is more complicated than it is worth.

    • Marked as answer by ata6502 Friday, May 30, 2014 3:04 PM
    Friday, May 30, 2014 2:42 PM
    Owner
  • OK, thanks. I will stick to the idea of keeping items in separate files. It does not look overly complicated.


    Wiki: wbswiki.com
    Website: www.wisenheimerbrainstorm.com

    Friday, May 30, 2014 3:04 PM