- Регистрация
- 21.08.2013
- Сообщения
- 249
- Благодарностей
- 12
- Баллы
- 18
I want to iterate through a list using c# in zenno.
I have this code:
This throws an error: Invalid format of the collection numbers. ElementsInCollection: 94 Path i
or
Cannot convert from int to string if I only use i without quotes so It's obvious it expects a string and not an int
Replacing i with 0 works!
I can also just use 0 and remove the items from list like this:
But removing the items from the list is not what I need.
I have this code:
Код:
int count = project.Lists["myList"].Count;
for (int i = 0; i<count; i++){
var k = project.Lists["myList"].GetItem("i", false);
}
or
Cannot convert from int to string if I only use i without quotes so It's obvious it expects a string and not an int
Replacing i with 0 works!
Код:
int count = project.Lists["myList"].Count;
for (int i = 0; i<count; i++){
var k = project.Lists["myList"].GetItem("0", false);
}
Код:
int count = project.Lists["myList"].Count;
for (int i = 0; i<count; i++){
var k = project.Lists["myList"].GetItem("0", true);
}