I have a DataTable with column Value and column Name that has 30000 rows. Now i would like to get very fast Name from row that Value has specified. How to do this fast? I have like 40000 requests with various Values to this table.
I’m interested in solution in C# and not on the database side.
Assuming you already have the DataTable, you can do:
Of course, if you are retrieving the DataTable only for this purpose, it is better to only select the data you need from the database. If this is data you are keeping in memory, then I recommend you go with JMarsch’s suggestion of using a Dictionary.