Yes...one would think so, meaning it should work. However, it doesn't. Or...I'm doing something wrong which could very well be the case.
The form has two sections. And the XPathNodeIterator object is cycling twice as expected. ( ie...the count being 2, which is correct. However, only the data from the first section is being referenced, and thus being inserted into the database tables. So I get two rows in the database table, with each row being identical...swell!
The code isn't erroring out, so I know my C# code that gets a handle to each control in the section is correct. It just dosen't seem to advance. The XPathNodeIterator object that is.
My code
XPathNavigator myNav = MainDataSource.CreateNavigator();
XPathNodeIterator NodeIterator = myNav.Select("/my:myFields/my:commentsResponseSection", NamespaceManager); //Repeating section
while (NodeIterator.MoveNext()) //Iterate through sections
{
string sComment = NodeIterator.Current.SelectSingleNode("//my:Comment", NamespaceManager).Value;
string sResponse = NodeIterator.Current.SelectSingleNode("//my:Response", NamespaceManager).Value;
// Some database calls to insert the data.......
}
So if I have values in my comments and responses controls in two sections such as
Section 1
----------------
Comment one
Response one
Section 2
----------------
Comment two
Response two
When the routine to insert the data completes, I have two rows in the table ( that's good) but with 'Comment one" & "Response one". That's not good. IN other words, I never get the "Comment two" or "Response two" values