Dim cells = From Qmaxminslist As DataGridViewRow In DataGridView2.Rows.Cast(Of DataGridViewRow)() Take Integer.Parse(daysamaxminsmv.Text)
For Each row As DataGridViewRow In cells
// piece of code...
Next
I have converted this code in C# as:
dynamic cells = from Qmaxminslist in DataGridView2.Rows.Cast<DataGridViewRow>() select (int.Parse(daysamaxminsmv.Text));
foreach (DataGridViewRow row in cells)
{
// piece of code...
}
but here comes an exception in the foreach statement saying:
"Cannot convert type 'int' to 'System.Windows.Forms.DataGridViewRow'"
how to solve it? any help will be appreciated. Thanks