I have a stored procedure to save individual rows of a repeating table as records in a database. What I need to do is to write a web service so I can loop through the rows in a repeating table as I call the stored procedure for however many rows there are.
I have used xsd.exe to create a class which I have included in my web service project and everything looks good, meaning that I can see all of my form fields in my project as expected, and I can handle everything else on the form that is not in the repeating table. I can see all the fields in the repeating table.
What I am having trouble with is, how do I loop through the rows in the repeating table? I had thought it would be as easy as something like:
foreach(int i in newForm.group1.Record)
or
for
(i = 0; i <= newForm.group1.Record.GetLength(); i++)
But I can't find what to use for the number of rows in the table. Am I thinking about this completely wrong? Should I be looking at the elements in the XML somehow instead?
Any help would be appreciated, please tell me if you think I am going about this all wrong.
A snippet from the template.xml for this form looks like (the "Record" is the repeating table):
<my:group1>
<my:txtContactName></my:txtContactName>
<my:cboOffice></my:cboOffice>
<my:txtAddress></my:txtAddress>
<my:txtCity></my:txtCity>
<my:txtZip></my:txtZip>
<my:txtEmail></my:txtEmail>
<my:txtPickUpParty></my:txtPickUpParty>
<my:txtPickUpDate></my:txtPickUpDate>
<my:txtOffice></my:txtOffice>
<my:txtTelephone></my:txtTelephone>
<my:txtExtension></my:txtExtension>
<my:Record>
<my:txtQuantity></my:txtQuantity>
<my:txtPubID></my:txtPubID>
<my:ddPubCat></my:ddPubCat>
<my:ddPubTitle></my:ddPubTitle>
</my:Record>
</my:group1>
Thanx
Terry