The text of this article is not in this database — only its details are. Read it on the old site: Read XML in C#
5 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: Read XML in C#
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Gohil JayendrasinhPosted May 14, 2012, 2:27 AM
Good One
thiago costaPosted Sep 26, 2011, 7:50 PM
hey man, thank you for providing us with this awesome code. I don't know much, but I usually take for ever to do this kind of thing, now its easy to learn from what is more likely to be obvious.
Arsenio MadrazoPosted Mar 29, 2011, 5:03 AM
Hi Prashanth First thnaks you for this great article. I've read it and tried to adapt to my own xml schema. This is a fragment of my xml file("Carrusel.xml") <Datos> <dato img_Url="images/galeria/foto_1.png" page_Url="http://www.atesa.es/webcorporativa/paginas/ofertas1.aspx" /> . . </Datos> And this is the code to write(to intend) a new node. void InsertItems(String sImagenUrl, String sPaginaUrl) { String rootPath = Server.MapPath("~"); String archivoXmlPath = Path.Combine(rootPath, "Xml//Carrusel.xml"); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(archivoXmlPath); XmlElement dato = xmlDoc.CreateElement("dato"); XmlAttribute imgenUrl = xmlDoc.CreateAttribute("img_Url"); XmlAttribute paginaUrl = xmlDoc.CreateAttribute("page_Url"); imgenUrl.InnerText = sImagenUrl; paginaUrl.InnerText = sPaginaUrl; dato.AppendChild("dato"); imgenUrl.InsertAfter("img_Url", "dato"); paginaUrl.InsertAfter("page_Url", "dato"); xmlDoc.DocumentElement.AppendChild("dato"); xmlDoc.Save(archivoXmlPath); } But I received errors. Where is the bug?. Thanks in advanced. Arsenio
angelo sucksPosted Oct 12, 2010, 7:22 PM
great code.. but can i add adding,edit,and del button..?whats the code..?thx b4