I have a for
loop that does not work properly for me. If I do a Debug, the increment always resets to 0 so it only reaches 1.
Here is part of the code:
First I loop % for
to call the userID
var userDataId = client.GetUser(DataSourceId);
for (int i = 0; i < userDataId.Length; i++)
{
string[] multiUserIDs = new string[] { userDataId[i].List[0].ToString() };
WS.TaskEntry[] resultGT3 = client.GetTasks3(multiUserIDs);
for (int s = 0; s < resultGT3.Length; s++)
{
file.WriteLine("{0}, {1}, {2}, {3}",
resultGT3[s].ProjectID,
resultGT3[s].UserID,
resultGT3[s].ProjectTitle,
resultGT3[s].StartDate);
}
}
Here the s++
always goes to 0 and only goes to 1.
I've also tried it with while
, but it has the same result:
int s = 0;
while (s < resultGT3.Length)
{
file.WriteLine("{0}, {1}, {2}, {3}",
resultGT3[s].ProjectID,
resultGT3[s].UserID,
resultGT3[s].ProjectTitle,
resultGT3[s].StartDate);
++s;
}
Could you help me identify what I'm doing wrong?