C# want change name in the second line how to change | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

C# want change name in the second line how to change

<CStudent> <student> <name>boy</name> <age>10</age> <location>paris</location> <phone>222-555</phone> </student> <student> <name>mark</name> <age>18</age> <location>korea</location> <phone>01026800393</phone> </student> </CStudent> Code c# _myXML.SelectSingleNode("CStudent/student/name").InnerText = txtName.Text; _myXML.SelectSingleNode("CStudent/student/age").InnerText = txtAge.Text; _myXML.SelectSingleNode("CStudent/student/location").InnerText = txtLocation.Text; _myXML.SelectSingleNode("CStudent/student/phone").InnerText = txtPhone.Text;

11th Mar 2018, 3:45 AM
lee ratana
4 Answers
+ 2
XmlDocument _myXML = new XmlDocument(); Yes Student Mark . How to change this Sir?
11th Mar 2018, 10:38 PM
lee ratana
+ 2
Use SelectNodes Place the nodes in a XMLNodeList And use a foreach-loop to loop throught the node list http://www.csharp-examples.net/xml-nodes-by-name/
11th Mar 2018, 10:51 PM
sneeze
sneeze - avatar
+ 2
I will try sir
12th Mar 2018, 7:23 AM
lee ratana
+ 1
What is the type of _myXML ? What do you mean by second line ? The node of student Mark or something else ?
11th Mar 2018, 7:57 PM
sneeze
sneeze - avatar