Click here to Skip to main content
15,889,992 members
Home / Discussions / C#
   

C#

 
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 
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 
Is there a reason you're not using linq-to-xml? It's much simpler (types from memory, so you may need to tweak it a bit)...

XDocument doc = XDocument.Load("myfile.xml");
XElement root = doc.Element["Rooms"];
foreach (XElement element in root.Elements)
{
    int roomID    = Convert.ToInt32(element.Element["RoomRQID"].Value);
    int quantity  = Convert.ToInt32(element.Element["Quantity"].Value);
    int numAdults = Convert.ToInt32(element.Element["NumAdults"].Value);
}


No messing around with InnerText and that kind of crap.

.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

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 
GeneralRe: Making a maths solver Pin
Matt Cavanagh10-Jan-10 22:31
Matt Cavanagh10-Jan-10 22:31 
AnswerRe: Making a maths solver Pin
PIEBALDconsult11-Jan-10 3:53
mvePIEBALDconsult11-Jan-10 3:53 
QuestionHow to convert text file pdf? Pin
Sunil G10-Jan-10 21:37
Sunil G10-Jan-10 21:37 
AnswerMessage Closed Pin
10-Jan-10 22:13
stancrm10-Jan-10 22:13 
GeneralRe: How to export data into excel or pdf? Pin
Sunil G10-Jan-10 23:06
Sunil G10-Jan-10 23:06 

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.