What should I use? I need to store data, and it only needs to be on the local machine. I will be storing all string variables, and in many columns.
What is the best? Would it even be a database?
What should I use? I need to store data, and it only needs to be on the local machine. I will be storing all string variables, and in many columns.
What is the best? Would it even be a database?
I would recomend db4o, an object database engine. It's pretty straightforward and no server or installation is needed on the client. Another alternative would be SQLite. You can get the .NET provider here.
Edit
See db4o tutorial here.
SQL Server Compact 3.5 SP1 does not require installation (You just need to deliver the .dlls, although check the EULA if that's allowed) and is rather straight forward to use.
I would recommend using sqlite, it's a very fast file-only, embedded-able, feature-rich, database. I have a lightweight ORM with C# bindings that abstracts and simplifies access to it. Here is a live web-service demo using sqlite.
Oh yeah db4o is a good choice as well which I also have C# database bindings for that supports C# automatic properties (as the default db4o provider doesn't) and other common data access scenarios.
You should look at SQLite if you're looking for an RDBMS or something like MongoDB if you're storing objects or similar.
Why not SQL Server Express? It's even free.
I would highly recommend checking out the serialization framework. It's not even close to the performance of a database, BUT, if you're not talking about a lot of data, it has about 100% less overhead. Serializing objects to a file in .net is child's play:
XmlSerializer serializer = new XmlSerializer(typeof(myObjectType));
using(FileStream stream = new FileStream("file", FileMode.Create, FileAccess.Write)
{
serializer.Serialize(stream, myObject);
}
That's it!
Reading back is pretty much the opposite. LINQ provides even more options. Again, this is not even close to a db in terms of performance, but I have seen many, many implementations wherein a database was extreme overkill for the amount of data being stored. Obviously, if you have a clear need to scale, etc, you'll want to plan for that. Right tool for the right problem and all that.
check out memcache if you want extremely fast speed. But they don't write to hard drive, so you might still need other mentioned db if you want to store them across sessions. In my project, we use mongodb to buffer data and use memcache to buffer for mongo. So data will be retrieved from memcache first, if not found, try mongo. If still not found, we then get new data.
For windows and .net, look at here
If you're just looking to store a small amount of data in a fairly simple structure, and aren't going to be doing any complex querying, then consider an XML file. You don't need any additional software, and you can work with it easily using LINQ to XML.