TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ankit Rathore
NA
74
0
Fetch XML file data in C#
Dec 1 2009 1:51 AM
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();
}
Reply
Answers (
1
)
Boxing and Unboxing
Could not use ''; file already in use in access database