Good Luís,
The error you have, as the message indicates, is that the definition Cells
does not exist for System.Data.DataRow
.
To get a column of a Row
specific within a DataTable
you have to do it in the following way:
foreach (double inter in intervalo)
{
if(nAle >= (double)intervalo[2*i] && nAle<=(double)intervalo[2*i-1])
{
i += 1;
pos = intervalo.Count;
table.Rows[i][i] += 1; //Pongo i respetando tu código, el segundo sería el índice de la columna
break;
}
}
The table.Rows[i].Cells[i]
works correctly when it comes to DataGridViewRow
, but in DataRow
is different, I recommend you look at the official Microsoft page and you are well informed of the differences of each class.