XML Browser in C# Windows Form
In this article we will see how to show dataset data in xmlbrowser.
In this article I’m using the xmlbrowser control from third party. This control will show the data of dataset in xml format as well you can load any existing xml document also. In windows form it’s not easy to show xml data while in web application browser only show the content of xml file.
Here I had just given this one sample example to show dataset data into xml format. I found this XmlRender.dll while google search. This XmlRender.dll file contain only XmlBrowser control. How to show our data in xml format we will see step by step.
Create new windows form application and add reference to this XmlRender.dll.
Now we have added reference write now we can access the control of XmlRender.dll file. Just create new XmlBrowser control at runtime.
XmlRender.XmlBrowser xml=new XmlRender.XmlBrowser();
Set some properties of this xmlbrowser control now in Designer.cs page
Just now get your Dataset object and set the XmlBrowser’s XmlText property to ds.GetXml() method which will display output as bellow.
Here we have seen some Xmlbrowser control to show our data in xml format. You can show xmldocument also in this browser using browser.XmlDocument property.