XML file into datagridview

Joe1

Active member
Joined
Dec 4, 2012
Messages
37
Programming Experience
Beginner
Hi,

I have an XML file with a parameter names, and its related descriptions. What is the best way for me to show these in a datagridview. with two columns, parameter and parameter description
 
Hi,

You should be able to read your xml file directly into a DataSet and then set the DataSource of a DataGridView to the index of the Table in the DataSet that represents the data you want to show. See Here:-

VB.NET:
Dim DS As New DataSet
DS.ReadXml("c:\YourPath\YourXMLFile.xml")
DataGridView1.DataSource = DS.Tables("YourTableIndex")

Hope that helps.

Cheers,

Ian
 
Back
Top