0

A very C# beginner question: Say I have a big table with data (a detailed "log" table of transactions, for example, held in a CSV file), and I need to perform database-like operations, such as queries (WHERE X > Y...), deletions, insertions and updates. This data comes from a file which is read, and from that moment this is "my database" to query and make changes to. Now the file is not too big (hundreds of KB's approximately), and not too complicated, namely I don't need any Inner Joins, or similar relations.

My very naive approach, since I am a beginner in C#, is to retrieve all the data into an object (Some Table / Dataset or similar objects), and use the LINQ functionality for my relatively simple queries. There is no use in any kind of external database on this project of mine.

I would appreciate any recommendations of how is the best way of doing it: what would be the best object to use (DataSet class? are there any other / easier / better performance classes for working with files and hold my data? how should the data be kept in the table - raw strings or object for each type?). Is there a common way it is usually done? Is the idea okay or should I use external classes? I could not find any good examples that match my situation exactly, probably because I didn't know how to search for it accurately enough, so any suggestions, especially ones accompanied with examples, are welcome!

Thanks in advance!

Hummus
  • 559
  • 1
  • 9
  • 21
  • 1
    Import to proper DB via SSIS (or equivalent) and use that – ChrisBint Mar 18 '14 at 12:06
  • Is this homework assignment? – Ikaso Mar 18 '14 at 12:18
  • Using a dedicated DB is not an option. This has nothing to do with any homework assignment I have, it's just some project of mine and we are currently denied the option of using a DB. Maybe seeking other solutions are not entirely the correct way to go, but at the moment this is what we can use. So thanks for the comment, but any new ideas that do not require a "real" database? Thanks! – Hummus Mar 18 '14 at 15:13
  • You can use SQLLite: this is a free, in-memory DB with drivers for .NET. I'd be inclined to use that as SQLLite is going to be at least as efficient when queried as an in-memory list of objects. – simon at rcl Mar 19 '14 at 14:44

0 Answers0