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 SanchezPosted Apr 14, 2009, 6:49 AM
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.
Vimal KandasamyPosted Apr 8, 2009, 5:35 AM
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 SanchezPosted Apr 8, 2009, 4:07 AM
XmlNode Node = DocXml.DocumentElement.LastChild;
// Create element
elem = DocXml.CreateElement("IP");
elem.InnerText = strIP;
Nodo.AppendChild(elem);
...
...
//DocXml.Save(fic);
Regards.
Javier SanchezPosted Apr 7, 2009, 3:33 AM
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.