XPathNodeIterator.MoveNext Does not move to next - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

XPathNodeIterator.MoveNext Does not move to next

Last post 01-23-2009 04:09 AM by swathip. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-22-2009 05:29 PM

    XPathNodeIterator.MoveNext Does not move to next

    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();
                            }

     

     

  • 01-23-2009 04:09 AM In reply to

    Re: XPathNodeIterator.MoveNext Does not move to next

    Hi,

    Did you add System.Xml.XPath name space? Are you getting any error?

    Once go through the below link to know how movenext method works.

    http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnodeiterator.movenext.aspx

    Swathip
    www.ggktech.com
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.