Load xml data to DataSet : XML DataSet « XML « ASP.Net






Load xml data to DataSet

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script language="VB" runat="server">

  Sub Page_Load(Sender As Object, E As EventArgs)

    Dim objDataSet    As New DataSet()

    objDataSet.ReadXml(Server.MapPath("Employees.xml"))
    
    dgEmployees.DataSource = objDataSet.Tables(0).DefaultView
    dgEmployees.DataBind()
    
  End Sub

</script>

<html>
  <body>
  <asp:DataGrid id="dgEmployees" runat="server" />
  </body>
</html>

           
       








Related examples in the same category

1.Display column information: dataset from xml file
2.Modify XML data set
3.Load XML data into DataSet