0

My program should:

  1. Load a data table from a legacy raw data file.
  2. Provide an interface to display, filter, graph, etc.

My approach is to create an in-memory database as a DataSource for binding the filter controls, results grid, graphs, etc.

Question: What is the simplest way to define and populate this in-memory database?

Edit: I only have a minimal knowledge of LINQ. In the past, I'd always been able to just drag a database table or query into the form or webpage. Visual Studio would create the DataSet, DataTable, DataSource, etc objects for me.

... where do I define this structure (an XML file, in-code, wizard, drag and drop)? what data objects do I need? etc

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Steven
  • 13,501
  • 27
  • 102
  • 146
  • What kind of size is the input file? How many rows? – Matt Jan 23 '13 at 20:26
  • About 100k rows by 20 columns – Steven Jan 23 '13 at 20:31
  • 1
    So, just create a class with the properties by which you need to search/filter/sort and another class that creates instances of those classes populated with data read from your file. There are plenty of LINQ extension methods to help you with advanced searching/sorting and reprojecting the objects. Am I missing something? – Matt Jan 23 '13 at 20:34
  • ... my minimal knowledge of LINQ. See main post edit. – Steven Jan 23 '13 at 20:48

1 Answers1

1

You could create classes containing the necessary properties and then simply parse the file and populate those classes in-memory. Here you go, you've got an in-memory database.

I only have a minimal knowledge of LINQ

Here's a good start for you: http://code.msdn.microsoft.com/101-LINQ-Samples-3fb9811b

where do I define this structure (an XML file, in-code, wizard, drag and drop)?

If you want to store the data in-memory define strongly typed C# classes that match your data.

what data objects do I need?

That would entirely depend on what information you have in your file and you want to handle.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • so... rather than defining a `DataSource` (for binding the values of filter controls, grid, graphs, etc), you recommend just updating those values with my own methods? – Steven Jan 23 '13 at 21:11
  • Yes, exactly. You could define models that represent your data and then simply bind the UI object DataSources to those models. – Darin Dimitrov Jan 23 '13 at 21:12
  • You answered my question (manually set values instead of DataBind). I'll post another question about how to implement the DataBind approach. Thanks! – Steven Jan 24 '13 at 15:43