In the code below I am iterating through a repeating group on my form and adding the items in it to a SharePoint list. Items do get added to the list but .MoveNext does not seem to be working. If I have 20 items in my repeating group I get 20 items created in my SharePoint list but the Title is set to the same value as the first nodes values in the repeating group.
Does .MoveNext actually work? If so how should I be using it?
I also tried using While loop instead of a for loop but no joy.
questions.MoveNext();
types.MoveNext();
for (int i=0;i<questions.Count;i++) //while (questions.MoveNext())
{
for (int j=0;j<types.Count;j++) //while (types.MoveNext())
{
if (list != null)
{
SPListItem item = list.Items.Add();
item["Title"] = types.Current.SelectSingleNode("/my:stuff/my:questions/my:question/my:types/my:ncTitle", this.NamespaceManager).Value;
item.Update();
}
types.MoveNext();
}
questions.MoveNext();
}