Help! I need to turn hashtables into usable info.
Ok, I'm working on a project and I promise this isn't for work or homework but for the sake of making it easy to explain I'm going to use a typical corporate example.
I created a parser that reads a site and creates entries. A single entry or ROW on the table creates a new instance of a class that I made. Let's say that each row is a single employee.
After the employee class object is created for a new entry and all the public properties (such as name, ID, location, age, etc.) are assigned, the parser then adds this employee into a hashtable using the emplyee ID as a key, and assigns the value to an instance of the Employee class as a system.object.
Ok, but my parser also looks for sections on a page, so the employees could be in different companies right? Like there could be 4 companies on a page with each company having different employees, so what I did was tell the parser to group all those employee entry hashtables into another hashtable, with the key of that table being the string representing the company name.
So here's the final format after all collections are said and done:
FinalHashTable (holds multiple CompanyName strings as keys and other embedded hashtables as values) ---> CompanyHashTable (EmployeeID as key, custom Employee object as value) ----> new instance Employee class (public properties and values).
What's the best way to take that main hash table and organize it into a datagrid or multiple grids by company name? I've been working on this for about a three days straight now and believe me it's got nothing to do with companies or employees. But the parser is really, really fast. I avoided using regular expressions entirely. Not bad for a coder who only started learning how to program last month, if I do say so myself. :D
Gentlemen, any help (advice) on how to use this data would be greatly appreciated. I don't need examples per se, I'm pretty resourceful, I would just like to know what some good methods would be. Like should I iterate each entry in the hashtable or what exactly.. should export these items to a database or can I use them while they are in memory? Also, I don't have to use a datagrid if there's a better way. As long as I can sort by company, then by name, ID, etc.
Thanks in advance,
KT