I am putting information from a folder into a datatable. I’m putting the info into the datatable using the following code line:
dtUpgradeFileInfo.Rows.Add(nums[0],nums[1],nums[2],test1);
It appears to be working but I’m not as familiar with datatables in C# as I am in VB. How would i search the datatable where the first column has a certain value and the third column has the highest value in case there are multiple rows with the same value in the first column. I am also unsure of how to retrieve the info once I’ve found the row I need. The type for each column is int,int,int,string respectively.
If by VB you mean VB.NET and not something like VB6, then the code to work with DataTables (as opposed to legacy VB recordsets) will be the same in C#. Rather, the methods you would employ, obviously the syntax will be differently because it’s C#. There’s semi-colons and brackets where you might except parentheses. But they’re using the same objects, calling the same methods.
Anyway, you could do this (C# 3.0+)
And for a non-LINQ answer (any version of C#)