Here is full code....Here i have used other way to write string into text file ie. WriteAllText function...
private void button1_Click(object sender, EventArgs e)
{
string text = select();
File.WriteAllText("file.txt", text);
}
public string select()
{
XmlDocument doc = new XmlDocument();
string s = "";
doc.Load("XMLFile1.xml");
XmlNodeList nodes = doc.SelectNodes("/root/row");
foreach (XmlNode node in nodes)
{
XmlAttributeCollection att = node.Attributes;
foreach (XmlAttribute att1 in att)
{
s = s + att1.InnerText + System.Environment.NewLine;
}
}
return s;
}
0 comments:
Post a Comment