ARTICLE

XML Browser in C# Windows Form

Posted by Krishna Garad Articles | XML March 23, 2011
In this article we will see how to show dataset data in XmlBrowser.
Reader Level:
Download Files:
 


Introduction:

In this article we will see how to show dataset data in XmlBrowser.

Background:

In this article I'm using the XmlBrowser control from a third party. This control will show the data of dataset in xml format and as well you can load any existing xml document. In a Windows form it's not easy to show xml data while in a web application browser; it only shows the content of the xml file.
Here I have just given this one sample example to show dataset data in xml format. I found this XmlRender.dll while doing a Google search. This XmlRender.dll file only contains the XmlBrowser control. We will see step by step how to show our data in xml format.

Step 1:

Create a new Windows Form application and add a reference to the XmlRender.dll.

Step 2:

Now that we have added a reference, now we can access the control in the XmlRender.dll file. Just create a new XmlBrowser control at runtime.

XmlRender.XmlBrowser xml=new XmlRender.XmlBrowser();

Set some properties of this XmlBrowser control now in Designer.cs page.

Step 3:

Now get your Dataset object and set the XmlBrowser's XmlText property to ds.GetXml() method which will display output as below.

xml.bmp

Conclusion:

Here we have seen use of the XmlBrowser control to show our data in xml format. You can show a XmlDocument also in this browser using the XmlBrowser.XmlDocument property.

Login to add your contents and source code to this article
post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Join a Chapter
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Get Career Advice from Experts