Answer the question
In order to leave comments, you need to log in
Still "Index out of range"?
It throws an error that is not yet clear with what it is connected with.
The data in the dgv is placed from the access database. At first I thought that this could be due to the fact that the 5th column of dgv at the time of the attempt to enter data into it is simply not defined (whether xs is determined automatically).
As a result, due to the difficulties of transferring the database from access, instead of determining the number of columns, I decided to add them to the database file.
Still didn't help.
What could be the problem?
for (int x = 0; x < 36; x++)
{
switch (x / 3)
{
case 0:
{
mas[x, 0] = mas[x, 0] * k1 * k11;
mas[x, 1] = mas[x, 1] * k1 * k11;
mas[x, 2] = mas[x, 2] * k1 * k11;
mas[x, 3] = mas[x, 3] * k1 * k11;
dataGridView1[5, x].Value = mas[x, 0]; //на этой строчке выдаёт ошибку
dataGridView1[6, x].Value = mas[x, 1];
dataGridView1[7, x].Value = mas[x, 2];
dataGridView1[8, x].Value = mas[x, 3];
break;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question