<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: How to iterate through a repeating table.</title><link>https://www.infopathdev.com:443/forums/thread/41336.aspx</link><pubDate>Wed, 06 May 2009 11:17:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41336</guid><dc:creator>madhuri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41336.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41336</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Try using &amp;#39;count&amp;#39;. &lt;/p&gt;</description></item><item><title>How to iterate through a repeating table.</title><link>https://www.infopathdev.com:443/forums/thread/41025.aspx</link><pubDate>Mon, 27 Apr 2009 20:15:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41025</guid><dc:creator>showet</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41025.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41025</wfw:commentRss><description>&lt;p&gt;I have a stored procedure to save individual rows of a repeating table as records in a database.&amp;nbsp; What I need to do is to write&amp;nbsp;a web service so I can loop through the rows in&amp;nbsp;a repeating table as I call the stored procedure for however many rows there are.&lt;/p&gt;
&lt;p&gt;I have used xsd.exe to create a class which I have included in my web service project and everything looks good,&amp;nbsp;meaning that I can see all of my form fields in&amp;nbsp;my project as expected, and I can handle everything else on the form that is not in the repeating table.&amp;nbsp; I can see all the fields in the repeating table.&lt;/p&gt;
&lt;p&gt;What I am having trouble with is, how do I loop through the rows in the repeating table?&amp;nbsp; I had thought it would be as easy as &lt;em&gt;something like&lt;/em&gt;:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;foreach&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; i &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;in&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; newForm.group1.Record)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;or&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;for&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (i = 0; i &amp;lt;= newForm.group1.Record.GetLength(); i++)&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;But I can&amp;#39;t find what to use for the number of rows in the table.&amp;nbsp; Am I thinking about this completely wrong?&amp;nbsp; Should I be looking at the elements in the XML somehow instead?&lt;/p&gt;
&lt;p&gt;Any help would be appreciated, please tell me if you think I am going about this all wrong.&lt;/p&gt;
&lt;p&gt;A snippet from the template.xml for this form looks like (the &amp;quot;Record&amp;quot; is the repeating table):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;lt;my:group1&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtContactName&amp;gt;&amp;lt;/my:txtContactName&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:cboOffice&amp;gt;&amp;lt;/my:cboOffice&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtAddress&amp;gt;&amp;lt;/my:txtAddress&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtCity&amp;gt;&amp;lt;/my:txtCity&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtZip&amp;gt;&amp;lt;/my:txtZip&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtEmail&amp;gt;&amp;lt;/my:txtEmail&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtPickUpParty&amp;gt;&amp;lt;/my:txtPickUpParty&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtPickUpDate&amp;gt;&amp;lt;/my:txtPickUpDate&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtOffice&amp;gt;&amp;lt;/my:txtOffice&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtTelephone&amp;gt;&amp;lt;/my:txtTelephone&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtExtension&amp;gt;&amp;lt;/my:txtExtension&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:Record&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtQuantity&amp;gt;&amp;lt;/my:txtQuantity&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:txtPubID&amp;gt;&amp;lt;/my:txtPubID&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:ddPubCat&amp;gt;&amp;lt;/my:ddPubCat&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:ddPubTitle&amp;gt;&amp;lt;/my:ddPubTitle&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/my:Record&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/my:group1&amp;gt;&lt;/p&gt;
&lt;p&gt;Thanx&lt;/p&gt;
&lt;p&gt;Terry&lt;/p&gt;</description></item></channel></rss>