I m tired to fix my logical error in my datagridview, can someone please help me. Here my code.
......
while (dr.Read())
{
int id = dr.GetInt32(0);
DateTime startBook = dr.GetDateTime(2);
DateTime endBook = dr.GetDateTime(3);
int startBook_C = startBook.Day;
int endBook_C = endBook.Day;
int TotalDays = endBook_C - startBook_C;
//dataGridView1(startBook_C, id - 1).Style.BackColor = Color.Blue;
dataGridView1.Rows[startBook_C].Cells[endBook_C-1].Style.BackColor = Color.Blue;
int i;
for (i = 1; i <= TotalDays; i++)
{
dataGridView1.Rows[startBook_C + i].Cells[endBook_C -1].Style.BackColor = Color.Blue;
//dataGridView1.Rows[startBook_C].Cells[carID - 1].Style.BackColor = Color.Blue;
// dataGridView1(startBook_C + i, id - 1).Style.BackColor = Color.Red;/* TODO ERROR: Skipped SkippedTokensTrivia */
TotalDays -= 1;
}
}
Con.Close();
......
我对数据网格的看法有问题,它有逻辑错误,我不知道我的错误是什么,为什么我在这里请各位主注意帮助确定我在数据网概览中的逻辑错误。 我的图像如下,请访问链接,看我的含义。
https://i.sstatic.net/AeUyrZ8J.png” rel=“nofollow noreferer”>