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();
`
I have a problem with datagridview, it’s logical error and I don’t know what is my error that why I ask here and attention to all master to help to fix my logical error in my datagridview. I have a image below, please visit the link to see what I mean.
image
New contributor
ras bry is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.