title: Create Two Data Table From XML Data Source With Relationship
body: <p>I Want to Create Two Data Table.</p>
  
  <p>First one Should <code>empid,firstname,lastname,location</code>, and</p>
  
  <p>Second Table Should give <code>empId,OrderId,details</code> thorugh this XML Data Source.</p>
  
  <p>I tried on that but It's not working. </p>
  
  <p>My code is: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
      &lt;details&gt;
        &lt;employee&gt;
          &lt;firstname&gt;Amit&lt;/firstname&gt;
          &lt;lastname&gt;Jain&lt;/lastname&gt;
          &lt;location&gt;Mumbai&lt;/location&gt;
          &lt;order&gt;
            &lt;orderId&gt;01254&lt;/orderId&gt;
            &lt;details&gt;Aaa,bbbb&lt;/details&gt;    
          &lt;/order&gt;
          &lt;order&gt;
            &lt;orderId&gt;01255&lt;/orderId&gt;
            &lt;details&gt;Aaa,bbbb&lt;/details&gt;
          &lt;/order&gt;
           &lt;/employee&gt;
        &lt;employee&gt;
          &lt;firstname&gt;User&lt;/firstname&gt;
          &lt;lastname&gt;1&lt;/lastname&gt;
          &lt;location&gt;Delhi&lt;/location&gt;
          &lt;order&gt;
            &lt;orderId&gt;01256&lt;/orderId&gt;
            &lt;details&gt;Aaa,bbbb&lt;/details&gt;
          &lt;/order&gt;
          &lt;order&gt;
            &lt;orderId&gt;01257&lt;/orderId&gt;
            &lt;details&gt;Aaa,bbbb&lt;/details&gt;
          &lt;/order&gt;
        &lt;/employee&gt;
        &lt;employee&gt;
          &lt;firstname&gt;User&lt;/firstname&gt;
          &lt;lastname&gt;2&lt;/lastname&gt;
          &lt;location&gt;Bangalore&lt;/location&gt;
          &lt;order&gt;
            &lt;orderId&gt;01258&lt;/orderId&gt;
            &lt;details&gt;Aaa,bbbb&lt;/details&gt;
          &lt;/order&gt;
          &lt;order&gt;
            &lt;orderId&gt;01259&lt;/orderId&gt;
            &lt;details&gt;Aaa,bbbb&lt;/details&gt;
          &lt;/order&gt;
        &lt;/employee&gt;
      &lt;/details&gt;
  </code></pre>
  
  <h2>C# Code</h2>
  
  <pre><code>   protected void btnReadXmlFile_Click(object sender, EventArgs e)
          {
              string filePath = Server.MapPath("~/example.xml");
              //Employee Must match with the element name in 
              //your file
              DataTable dt = new DataTable("employee");
  
              //Add Columns in datatable
              //Column names must match XML File nodes
              DataColumn column = new DataColumn();
              column.DataType = System.Type.GetType("System.Int32");
              column.AutoIncrement = true;
              column.ColumnName = "EmpID";
              dt.Columns.Add(column);
              dt.Columns.Add("firstname", typeof(System.String));
              dt.Columns.Add("lastname", typeof(System.String));
              dt.Columns.Add("location", typeof(System.String));
  
              //Read XML File And Display Data in GridView
              dt.ReadXml(filePath);
              GridView1.DataSource = dt;
              GridView1.DataBind();
  
              //
              DataTable dt2 = new DataTable("order");
  
              //Add Columns in datatable
              //Column names must match XML File nodes
              DataColumn column2 = new DataColumn();
              column2.DataType = System.Type.GetType("System.Int32");
              column2.AutoIncrement = true;
              column2.ColumnName = "ID";
              dt2.Columns.Add(column2);
              dt2.Columns.Add("orderId", typeof(System.String));
              dt2.Columns.Add("details", typeof(System.String));
  
  
              //Read XML File And Display Data in GridView
              dt.ReadXml(filePath);
              GridView2.DataSource = dt2;
              GridView2.DataBind();
          }
  </code></pre>
  
  <p>Can any one please help me on this??    </p>