Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Reply
Fetch XML file data in C#
Ankit Rathore
Dec 1 2009 1:51 AM
6.8k
Reply
Hi Guys
I am very new in DOTNET....
See this below code,
everything is going gud but in textbox1 I am not able to print..............
here I am working for only one node that is
(EmpId)
which is going to be print in textbox1. But I want 1 by 1 only.
private void FetchXML()
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(xmlpath);
XmlElement root = xmldoc.DocumentElement;
XmlNode node = root.SelectSingleNode("
EmployeeID");
XmlNodeList nodelist = node.SelectNodes("EmpId");
foreach (XmlElement elment in nodelist)
{
string str = elment.InnerText;
//Not able to print EMPID one by one in textBox1
textBox1.Text = str;
----> Problem with this line only to get data(What will be the code here to get data which is in str).
//MessageBox.Show(str);
-------
----------> if we print in Message box then its working properly .........
}
}
private void btnFetch_Click(object sender, EventArgs e)
{
FetchXML();
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Boxing and Unboxing
Could not use ''; file already in use in access database