[Solved] How to perform the below mentioned task(vb.net)?
You haven’t converted it correctly. The VB code selects DataGridViewRows, the C# code selects ints. You want to take N rows. VB.NET supports Enumerable.Take directly in the LINQ query, C# does not support it. So i’d use method syntax in C#. So this works as desired (don’t translate Dim with dynamic but var): int takeRows … Read more