This blog is about the dotnet.all types of codes,news about dotnet including asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.ncluding asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.asp.net programming,dot net programming,dotnet programs,dotnet source code,source code.

Free Hosting

Free Hosting

Friday, May 16, 2008

Creating XML File in DotNet

For creating dynamic xml file you need to import System.Xml namespace

Private void CreateXmlFile()
{
// Creating XML with saving file location
XmlTextWriter xmlWriter = new XmlTextWriter(Server.MapPath(".") "propertydetails.xml", System.Text.Encoding.UTF8);
xmlWriter.WriteStartDocument();
//For Creating XML Root Element
xmlWriter.WriteStartElement("RootElemet");

//For Creating ChildXMlNode
xmlWriter.WriteStartElement("ChildNode");

//For Creating XMLSubChildNode
xmlWriter.WriteElementString("SubChildNode", "TextforSubChildNode");
// Closing XMLChildNodexmlWriter.WriteEndElement();// Closing XMLChildNode
// Closing XMLRootNode
xmlWriter.WriteEndDocument();
//Closing File
xmlWriter.Close();
}

0 comments:

dotnet(.Net) Project Source code Downloads and Tutorials

Email Subscrption



Enter your email address:

Delivered by FeedBurner

Feedburner Count

Unique Visitor

Design by araba-cı | MoneyGenerator Blogger Template by GosuBlogger