How to read data from an XML file and display it in a DataGrid

Platform: ASP.NET| Category: XML

VB.NET


dim ds as new DataSet()
ds.ReadXml (Server.MapPath ('products.xml'))
DataGrid1.DataSource =ds
DataGrid1.DataBind()

C#


DataSet ds= new DataSet ();
ds.ReadXml (Server.MapPath ('products.xml'));
DataGrid1.DataSource =ds;
DataGrid1.DataBind();

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.