Can't do it. Instead though, why not just a for loop? Then you can do something like:
for(int i = 0 ; i < outputXml.Count;i++)
{
// get the current item
ResponseItem itm = outputXml[i];
// get the next item
ResponseItem nextitm = null;
if(i < (outputXml.Count -1)
{ nextitm = outputXml[i];}
}
Don't forget to mark useful responses as Answer if they helped you towards a solution.
Member
36 Points
67 Posts
Get Column Value of Next Row in foreach Loop
Aug 06, 2014 07:36 PM|aspkermit|LINK
Hello,
In this scenario there can be multiple output for the same item if there are different start dates for an item.
I am looping through response items in XML output and need to be able to grab the next value and perform a calculation as follows:
(If there is only one line item (or if it is the last item) returned, end date = '12/31/2099' else end date = <start_date> on next line item – 1 day)
Here is the XML output for an item with 2 start dates:
Here is the C# code-behind which passes values to and returns from the web service:
Any help would be greatly appreciated.
Thanks,
Buster
All-Star
26071 Points
5892 Posts
Re: Get Column Value of Next Row in foreach Loop
Aug 07, 2014 12:56 AM|markfitzme|LINK
Can't do it. Instead though, why not just a for loop? Then you can do something like: