I am still relatively new to C# and I was wondering if there is a built-in function to do the following:
-I am loading rows from a database into a DataGridView via a DataTable
-I have many rows with the same value in one column but a differing value in antoher column, EG:
NAME, PRICE
chair, 7.00
chair, 6.00
chair, 8.00
table, 15.00
table, 17.00
plate, 4.00
plate, 4.50
Does anyone have any knowledge on how to loop through each row, and take the cheapest price for each product and send it to another List/Object?
I have only started using DataTables and DataGridView elements today so I am a little uncertain the best way to proceed. Basically I want an end list containing one of each product with the cheapest price found next to it. EG
NAME, PRICE
chair, 6.00
table, 15.00
plate, 4.00
I am not sure if using an Object, List or Dictionary would be the best in this situation and was wondering if someone can shed some more light please. :)
Thanks for any help