A simple method to bind an XML file to a Grid view Control

Godly77
Posted by Godly77 under ASP.NET category on | Points: 40 | Views : 2166
A simple method to bind XML file to a GridView i ASP.net


<asp:GridView ID="GridView1" runat="server">
</asp:GridView>




Dim DSet As New System.Data.DataSet
DSet.ReadXml(Server.MapPath("XMLFile.xml"))
GridView1.DataSource = DSet.Tables(0)
GridView1.DataBind()

Comments or Responses

Posted by: T.saravanan on: 10/23/2011 Level:Silver | Status: [Member] [MVP] | Points: 10
Hi Godly77,

kindly give a format of the XML file. I think your code is not supported to bind all type xml files (If the node have more than inner node).

Login to post response