PDA

View Full Version : C# Data Storage Help



Celestial
05-05-2013, 11:19 PM
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.

Zachafer
05-05-2013, 11:48 PM
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.

Celestial
05-06-2013, 02:08 AM
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.

Zachafer
05-06-2013, 11:12 AM
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 [Only registered and activated users can see links]-snippet-1

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

Celestial
05-06-2013, 10:00 PM
Have you ever worked with serialization? More specifically I'd suggest reading XML Serialization [Only registered and activated users can see links]-snippet-1

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?

Zachafer
05-06-2013, 10:28 PM
I imagine that would make searching through the data (via multiple criteria) and ordering annoying?

Not too bad, you can use XPath
[Only registered and activated users can see links]

But I'd suggest LINQ over XPath anyday.

var qry = xmlDoc.Descendants("Items").Elements("Item").Where(x => x.Attribute("name").Value == "Palm Fan"); //x for node