SIGN UP MEMBER LOGIN:    
ARTICLE

XML Browser in C# Windows Form

Posted by Krishna Garad Articles | XML in C# 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
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor