Results 1 to 6 of 6

Thread: C# Data Storage Help

  1. #1

    Joined
    Oct 2012
    Posts
    197
    Userbars
    2
    Thanks
    11
    Thanked
    87/50
    DL/UL
    18/0
    Mentioned
    30 times
    Time Online
    5d 9h 44m
    Avg. Time Online
    1m

    Exclamation C# Data Storage Help

    So I'm writing an app, let's call it for instance "Neopets Item Informer" which contains all the information of all items in the game, which a person can download and run.

    What is the best way to store this info?

    I want all the advantages of quick simple searching like SQL.
    I don't really want people to be able to simply steal my DB.
    The dataset will have about 30,000 - 40,000 records.

    What would also be great is if the db could be embedded in the exe file. In which case I'm not too worried about the inability to write to the file.


    What would you guys recommend as the best method?

    P.S. The program I'm making is not the one I described, but is pretty similar in all functionality.
    Last edited by Celestial; 05-05-2013 at 11:32 PM.
    If my post helped please send $2,000,000 via PayPal!

  2. #2
    Zachafer's Avatar
    Joined
    Dec 2011
    Posts
    1,235
    Userbars
    11
    Thanks
    769
    Thanked
    1,466/678
    DL/UL
    98/0
    Mentioned
    512 times
    Time Online
    24d 13h 9m
    Avg. Time Online
    8m
    If you are ok with hosting it on localhost, I'd recommend SQLite. There is a complete C# port or .NET wrappers for SQLite. Embedding the database into the .exe / anywhere localhost is going to increase the download size significantly.

    If you don't want your database stolen, you can't store it locally, bottom line. If security is a huge concern, I'd recommend hosting your database somewhere (mySQL).

    Personally if I was building a complete item database I'd use MySQL with phpMyAdmin.

    My two cents.

  3. #3

    Joined
    Oct 2012
    Posts
    197
    Userbars
    2
    Thanks
    11
    Thanked
    87/50
    DL/UL
    18/0
    Mentioned
    30 times
    Time Online
    5d 9h 44m
    Avg. Time Online
    1m
    Quote Originally Posted by Zachafer View Post
    If you are ok with hosting it on localhost, I'd recommend SQLite. There is a complete C# port or .NET wrappers for SQLite. Embedding the database into the .exe / anywhere localhost is going to increase the download size significantly.

    If you don't want your database stolen, you can't store it locally, bottom line. If security is a huge concern, I'd recommend hosting your database somewhere (mySQL).

    Personally if I was building a complete item database I'd use MySQL with phpMyAdmin.

    My two cents.
    The privacy is only a moderate concern, I just don't want to make it TOO easy. More importantly I don't want to waste lots of time worrying about too much and I don't want the app to need to rely on a server-based database.

    I don't care about the size of the download, the entire db is about 10mb before compression and removal of unwanted info.

    Not done a lot of work with MS stuff, I find their documentation severely lacking.
    If my post helped please send $2,000,000 via PayPal!

  4. #4
    Zachafer's Avatar
    Joined
    Dec 2011
    Posts
    1,235
    Userbars
    11
    Thanks
    769
    Thanked
    1,466/678
    DL/UL
    98/0
    Mentioned
    512 times
    Time Online
    24d 13h 9m
    Avg. Time Online
    8m
    Quote Originally Posted by Celestial View Post
    The privacy is only a moderate concern, I just don't want to make it TOO easy. More importantly I don't want to waste lots of time worrying about too much and I don't want the app to need to rely on a server-based database.

    I don't care about the size of the download, the entire db is about 10mb before compression and removal of unwanted info.

    Not done a lot of work with MS stuff, I find their documentation severely lacking.
    Have you ever worked with serialization? More specifically I'd suggest reading XML Serialization (you need an account to see links)

    I'd imagine the XML organization style would be appealing to an item database

  5. #5

    Joined
    Oct 2012
    Posts
    197
    Userbars
    2
    Thanks
    11
    Thanked
    87/50
    DL/UL
    18/0
    Mentioned
    30 times
    Time Online
    5d 9h 44m
    Avg. Time Online
    1m
    Quote Originally Posted by Zachafer View Post
    Have you ever worked with serialization? More specifically I'd suggest reading XML Serialization (you need an account to see links)

    I'd imagine the XML organization style would be appealing to an item database
    I imagine that would make searching through the data (via multiple criteria) and ordering annoying?
    If my post helped please send $2,000,000 via PayPal!

  6. #6
    Zachafer's Avatar
    Joined
    Dec 2011
    Posts
    1,235
    Userbars
    11
    Thanks
    769
    Thanked
    1,466/678
    DL/UL
    98/0
    Mentioned
    512 times
    Time Online
    24d 13h 9m
    Avg. Time Online
    8m
    Quote Originally Posted by Celestial View Post
    I imagine that would make searching through the data (via multiple criteria) and ordering annoying?
    Not too bad, you can use XPath
    Code:
    xmlDoc.XPathSelectElements(@"/Items[@(you need an account to see links)='Palm Fan']");
    But I'd suggest LINQ over XPath anyday.
    Code:
    var qry = xmlDoc.Descendants("Items").Elements("Item").Where(x => x.Attribute("name").Value == "Palm Fan"); //x for node

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •