I have the following loop :
for (int i = 0; i < Main_dt.Rows.Count; i++)
{
}
Now i have one condition :
if (dt.Rows.Count > 0)
{
}
What i wanna to do is :
if the condition is true then :
increment the variable j by 1 every two iterates,i mean like this :
0 0 1 1 2 2
if the condition is false then :
increment the variable j by 1 every three iterates,i mean like this :
0 0 0 1 1 1 2 2 2
It sounds like you really want:
There may well be a better way of approaching this, but it’s hard to know without more information about what you’re trying to achieve.