Click here to Skip to main content
15,891,431 members
Home / Discussions / C#
   

C#

 
AnswerRe: Looping through XMLNodeList problem Pin
Keith Barrow11-Jan-10 0:00
professionalKeith Barrow11-Jan-10 0:00 
GeneralRe: Looping through XMLNodeList problem Pin
jamesc6911-Jan-10 0:05
jamesc6911-Jan-10 0:05 
GeneralRe: Looping through XMLNodeList problem [modified] Pin
Keith Barrow11-Jan-10 0:11
professionalKeith Barrow11-Jan-10 0:11 
GeneralRe: Looping through XMLNodeList problem Pin
jamesc6911-Jan-10 0:23
jamesc6911-Jan-10 0:23 
GeneralRe: Looping through XMLNodeList problem Pin
Luc Pattyn11-Jan-10 0:47
sitebuilderLuc Pattyn11-Jan-10 0:47 
GeneralRe: Looping through XMLNodeList problem Pin
Keith Barrow11-Jan-10 0:54
professionalKeith Barrow11-Jan-10 0:54 
GeneralRe: Looping through XMLNodeList problem Pin
jamesc6911-Jan-10 1:08
jamesc6911-Jan-10 1:08 
GeneralRe: Looping through XMLNodeList problem Pin
Keith Barrow11-Jan-10 1:35
professionalKeith Barrow11-Jan-10 1:35 
jamesc69 wrote:
If I run in debug mode, on the first pass through ForEach it says that the innertext will be 113 (for the whole occurrence of that node), on the second pass it says that the innertext will be 212 (which is correct).



OK, so we've eliminated two possibilities: The xmlDoc.SelectNodes is selecting the node correctly and the loop is iterating over the nodes correctly.


jamesc69 wrote:
I know this can be a problem with say SelectSingleNode, but I'm not using that. So therefore objRNode["RoomRQId"].InnerText is not iterative, and is always picking the 1st occurence with the document.


Correct xmlnode["NodeName"].InnerText is not iterative, however you are the source xmlnode(in your case objRNode) is the result of an interation. So you will get the objRNode["RoomRQId"].InnerText will get the InnerText of the current objRNode's RoomRQId correctly. Both the code I posted earlier shows that to be the case and Luc Pattyn has tested it.


jamesc69 wrote:
So therefore objRNode["RoomRQId"].InnerText is not iterative, and is always picking the 1st occurence with the document.


Not necessarily (see above). It is possible that, as Luc said, SelectHotelAvail() is fouling up somehow. It is possible that the output code is not working as expected, or that somehow the value is being set in another place (e.g. later in the code, concurrency problems). Without full source code this is hard to find.

The line intRoomRQId = int.Parse(objRNode["RoomRQId"].InnerText); should get the correct Id. I'd use a breakpoint to ensure that correct ID is being set by that line, then step through to see if it changes.

CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks

GeneralRe: Looping through XMLNodeList problem Pin
Luc Pattyn11-Jan-10 2:09
sitebuilderLuc Pattyn11-Jan-10 2:09 
GeneralRe: Looping through XMLNodeList problem Pin
Keith Barrow11-Jan-10 2:23
professionalKeith Barrow11-Jan-10 2:23 
GeneralRe: Looping through XMLNodeList problem Pin
jamesc6911-Jan-10 2:33
jamesc6911-Jan-10 2:33 
GeneralRe: Looping through XMLNodeList problem Pin
Keith Barrow11-Jan-10 3:00
professionalKeith Barrow11-Jan-10 3:00 
AnswerRe: Looping through XMLNodeList problem Pin
#realJSOP11-Jan-10 3:31
mve#realJSOP11-Jan-10 3:31 
QuestionHow do I get the location and size of the upper leftmost cell in a DataGridView? Pin
arnold_w10-Jan-10 22:25
arnold_w10-Jan-10 22:25 
AnswerRe: How do I get the location and size of the upper leftmost cell in a DataGridView? Pin
sanforjackass10-Jan-10 23:55
sanforjackass10-Jan-10 23:55 
GeneralRe: How do I get the location and size of the upper leftmost cell in a DataGridView? Pin
arnold_w11-Jan-10 0:02
arnold_w11-Jan-10 0:02 
Questionappending text Pin
Member 59031010-Jan-10 22:23
Member 59031010-Jan-10 22:23 
AnswerRe: appending text Pin
Nicholas Butler10-Jan-10 22:27
sitebuilderNicholas Butler10-Jan-10 22:27 
AnswerRe: appending text Pin
Abhinav S10-Jan-10 22:59
Abhinav S10-Jan-10 22:59 
QuestionCant Write Large Text File Pin
salamonty8610-Jan-10 21:49
salamonty8610-Jan-10 21:49 
AnswerRe: Cant Write Large Text File Pin
Covean10-Jan-10 22:13
Covean10-Jan-10 22:13 
GeneralRe: Cant Write Large Text File Pin
salamonty8611-Jan-10 0:27
salamonty8611-Jan-10 0:27 
GeneralRe: Cant Write Large Text File Pin
Covean11-Jan-10 1:19
Covean11-Jan-10 1:19 
QuestionMaking a maths solver Pin
Matt Cavanagh10-Jan-10 21:37
Matt Cavanagh10-Jan-10 21:37 
AnswerRe: Making a maths solver Pin
Rob Philpott10-Jan-10 22:13
Rob Philpott10-Jan-10 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.