I have a form that contains similar types of information that appears in different sections of the form. Once a user is done filling out that form I want to grab all the like information and consolidate it into a single repeating table.
I've found a few good resources that shows me how to access and add values to repeating tables/sections in the main data source, but I'm having issues getting it to work pointing to a secondary data source.
Here's an example of code that works in the main data source to add a row to a repeating table (note: I did not include the part that writes the actual values to the row)
string myNamespace = NamespaceManager.LookupNamespace("my");
using (XmlWriter writer = MainDataSource.CreateNavigator().SelectSingleNode(
"/my:myFields/my:group1", NamespaceManager).AppendChild())
I have 2 questions
- 1) Does the secondary data source use the "My" NameSpace?
- 2) My secondary data source is a web service named ReceiveData. When I added it to my data connections, under data source it looks as follows:
myFields
queryFields
tns:Group1
:Group2
:item
Field1
Field2
Etc
I changed the above code to be the following:
string myNamespace = NamespaceManager.LookupNamespace("my");
DataSource ds = DataSources["ReceiveData"];
Using (XmlWriter writer = ds.CreateNavigator().SelectSingleNode("/my:myFields/my:queryFields/my:tns:group1/my::Group2", NamespaceManager).AppendChild())
I get /my:myFields/my:queryFields/my:tns:group1/my::Group2 contains an invalid token error which I'm assuming is because there are extra : in the names of the elements returned by the web service.
I'm not sure where to go from here, I'm beyond the realm of documentation
Any Ideas?