Library code snippets

XBrowse

XBrowse is a small application that allows the user to view and edit XML files as well as extract XSD schema files from the XML document. It is overall a pretty simple program that is based off of a code snippet in the VS.Net IDE.

Comments

  1. 02 Jul 2008 at 17:13

    I modified the code to accept an XML string instead of opening a file.

     

    Public Message As String

    Public Sub LoadXML()

    Dim d As New DataSet() 'Dim local dataset object for this method

    Try

    Dim XmlDataDocument As New XmlDataDocument

    XmlDataDocument.DataSet.ReadXml(New IO.StringReader(Message))

    d = XmlDataDocument.DataSet.Copy

    dg1.DataSource = d ' bind datagrid control to the local dataset object

    Catch exp As Exception ' catch any exceptions that may get thrown and display in messagebox

    MessageBox.Show(exp.Message.ToString, "Exception was caught", MessageBoxButtons.OK, MessageBoxIcon.Error)

    End Try

    ds = d.Copy 'copy local dataset object up to global dataset for persistance

    dg1.DataSource = ds 'reset datagrid datasource property to global dataset object

    dg1.Refresh() 'refresh datagrid

    dg1.Collapse(-1) 'collapse datagrid to get back to root node

    d.Dispose() ' dispose of local dataset object

    End Sub

  2. 01 Jan 1999 at 00:00

    This thread is for discussions of XBrowse.

Leave a comment

Sign in or Join us (it's free).

J P

Related discussion

Related podcasts

  • LINQ to XML

    Scott's been poking around with LINQ to XML and reports his findings to Carl about life with XDocuments and XElements. They also talk about the bridge classes that link (no pun intended) System.Xml and System.Xml.Linq.

Want to stay in touch with what's going on? Follow us on twitter!