I am retrieving five columns through an SQL query. Among the columns retrieved, I have a column RecordID which should act as a key to a dictionary.
I am referring to the solution posted: C# Multi-Value Dictionary at StackOverflow, but I am not able to use it effectively depending upon my situation.
I want to store all the rows of my query but the RecordID column should also act as a key to the dictionary element. I want something like:
Dictionary<RecordID, Entire columns of the current row for this RecordID>
An alternative I think is to use an array, something like:
Dictionary<key,string[]>
But I want to use any super-fast way.
Use a
Lookup– you haven’t said much about the data, but you may need something as simple as:There are, of course, overloads for
ToLookupwhich allow you to do other things.