1

It's a general question. I know there are different ways to store huge amounts of data in memory, retrieve it from there and process, so I found such thing as hashmap, hashtable.

The problem is that I have no idea how to declare and use it in asp.net (C#). Can you tell me how to:

  1. Declare hashmap in code-behind

  2. Put data into it

  3. Retrieve data from it

  4. What is key and what is value? In terms of a table with 5 columns and 3 rows, what is considered to be keys and values? How to load this table in memory using Hashmap or Dictionary?

What would you recommend for fast loading huge tables of data in memory and quickly iterate through it to build an html table?

  • 1
    See http://stackoverflow.com/questions/1273139/c-sharp-java-hashmap-equivalent# – Sami Kuhmonen Jun 30 '15 at 04:39
  • You want us to copy and paste the example from the MSDN help for dictionary I linked to below? – Mick Jun 30 '15 at 05:11
  • Why load a huge sql table in memory? You have simple SQL table. Why not just consume the table? Why are you set on making this hard and using up memory? What is the problem you are trying to solve? http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem – paparazzo Jun 30 '15 at 14:10

1 Answers1

1

If you're wanting to do this Server Side, I think you're looking for C# Dictionary class.

https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx

In ASP.NET especially if this is for caching purposes you should probably be looking at using the ASP.NET Cache

https://msdn.microsoft.com/en-us/library/aa478965.aspx

Mick
  • 6,527
  • 4
  • 52
  • 67