Hi everybody!!
I wolud like to know which method can i follow for write at the end of an existing XML document. I already have seen another topics about it in this forum, but i'm in the same point still.
I have read is necessary create a DataSet? If is that true, what i have to do with the DataSet?
Some help please..!?
Thanks!!
Loading

Javier Sanchez8 reputationPosted Apr 6, 2009, 11:33 PM EDT
I have think about create a DataSet, create columns and give valors to the rows and later using myDataSet.WriteXml("C:\\myXmFile.xml")..but is not a viable way.
Some nice person can help me please? i think it's a good subject for discuss about it, because i'm looking and is not some stuff out there in google.
Regards.
Javier Sanchez8 reputationPosted Apr 8, 2009, 12:07 AM EDT
XmlNode Node = DocXml.DocumentElement.LastChild;
// Create element
elem = DocXml.CreateElement("IP");
elem.InnerText = strIP;
Nodo.AppendChild(elem);
...
...
//DocXml.Save(fic);
Regards.
Vimal KandasamyRank #2,151 · 661 reputationPosted Apr 8, 2009, 1:35 AM EDT
try this,
XmlDocument doc = new XmlDocument();
FileStream st = new FileStream(filepath, FileMode.Open);
doc.Load(st);
XmlElement el = doc.CreateElement("IP");
el.InnerText = strIP;
doc.DocumentElement.AppendChild(el);
st.Close();
doc.Save(filepath);
Javier Sanchez8 reputationPosted Apr 14, 2009, 2:49 AM EDT
i can't use fileStream because finally i can't have the XML document in a hard drive.
So i had to play with the nodes.
Regards to everybody.