If you require knowing how to save information in one data, please go through online information and it can offer you clear cut way on your any enquiry.

There are multiple ways this can be done. Here are examples of ways I have done it (and do now):

  • Text File (.txt)
  • Excel
  • SQLite (read/write like you would a normal database, but it's a local file)
  • XML
  • BMP (sorry, had to throw that in, I had some fun once of storing information in an image).

Text Files are nice if it's a large clump of data to read and right. However, if you want to split the data up into say categories, this is probably not the best way (I did make it work once, but it could have led to countless issues)

Excel is probably not the best one either. While it can offer functionality like a database when it comes to breaking up data and storing it (much like you would if you were to use an Excel file you manually populated). I am not a huge fan of the Interop library as I had issues with it leaving EXCEL processes open, plus I think it's not what you would want.

SQLite, as I mentioned is nice because you read and write data to it like you would a SQL database. However, it's stored a single file, and no need to install any drivers or have a server to host the database. It does require external libraries, but they are small, and maintained (here's where I get them from http://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki)

XML is one I recently learned. It took some time for me personally to figure out (how exactly to read and write, hint: Xpath), but once I did, I became addicted. It's nice to use as it doesn't require extra libraries (other then what .NET should already have). Also, it's a nice single .XML file. Even better it's human readable. You can easily open an XML file, and read it. Oh yeah and it's like database in the sense that you can break up and categorize your data. I have a program I am working on that has multiple collections of data, all with multiple variables. The XML file allows me to easily store that data. However, do realize that with XML, I believe it's designed that you read in the entire document at run time, and work with it in memory (like with a variable), and then write it back when done.

BMP, like I said I was joking around with this one. I did it once, but would strongly advise against it. It was me messing around with file headers and working with data in the byte form

So that should get you started. I personally really like SQLite and XML, with XML taking more and more of the front run because I don't need to include extra libraries with my projects ... but there are times when SQLite is needed (especially when it's large amounts of data)

Edited 2 Years Ago by JOSheaIV

This article has been dead for over six months. Start a new discussion instead.