.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

How to create the XML string using xmldocument?

Posted By: chandrakant     Posted Date: February 21, 2011    Points:2   Category :Windows Application
I want to create the xml string using xml document object can any one help me?i am using c#.net.

Thanks you

Responses
Author: Sunil Yadav       [Moderator]      
Posted Date: February 22, 2011     Points: 5   

Hi,

Try below code.

XmlDocument document = new XmlDocument();
document.Load("C:\xmlfile.xml");
StringWriter sw = new StringWriter();
XmlTextWriter xtr = new XmlTextWriter(sw);
document.WriteTo(xtr);
return sw.ToString();


Author: Blessy Baby             
Posted Date: February 22, 2011     Points: 5   

Hi.

try this

XmlDocument doc=new Xmldocuemnt();
doc.Load("d:\\test.xml");
return doc.InnerXml;

Blessy Baby
Project Lead
Digitalmesh Softech India (p) Limited
Cochin,Kerala


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend