View Single Post
Light Poster
30Oct2010,12:42  
blackrubybarb's Avatar
Quote:
Originally Posted by agile View Post
hi

i am new to c# and xml. i have made a xml file by c# where the tags are Information,Fname,Lname,Username.

now i want to read value from Fname tag and set the value in a text box.
i also want to read value from Lname tag and set the value in a text box

how can i do this.

agile
XmlDocument xDoc = new XmlDocument();
xDoc.Load(@"your_xml_file_Path.xml");
XmlNodeList Fname = xDoc.GetElementsByTagName("Fname");
XmlNodeList Lname = xDoc.GetElementsByTagName("Lname");
textBox1.Text = Fname[0].InnerText;
textBox2.Text = Lname[0].InnerText;