<? Xml version = "1.0" encoding = "UTF-8"?>
<GoodsInfo>
<Item>
<GoodsClass> flowers and plants </GoodsClass>
<GoodsName> rose </GoodsName>
</Item>
<Item>
<GoodsClass> flowers and plants </GoodsClass>
<GoodsName> chrysanthemum </GoodsName>
</Item>
<Item>
<GoodsClass> flowers and plants </GoodsClass>
<GoodsName> rose </GoodsName>
</Item>
<Item>
<GoodsClass> fashion gift </GoodsClass>
<GoodsName> pearl earrings </GoodsName>
</Item>
<Item>
<GoodsClass> fashion gift </GoodsClass>
<GoodsName> beads bracelet </GoodsName>
</Item>
<Item>
<GoodsClass> fashion gift </GoodsClass>
<GoodsName> taixiao watch </GoodsName>
</Item>
<Cl>
<GoodsClass> chenlu </GoodsClass>
<GoodsName> xiao </GoodsName>
<Goodsu> liuliu </Goodsu>
</Cl>
</GoodsInfo>
DataSet ds = new DataSet ();
Ds. ReadXml (Server. MapPath ("~ /XMLFile. xml "));
This. GridView1.DataSource = ds;
This. GridView1.DataBind ();
In this way, ds loads two tables.
The field in the Item table is GoodsClass and GoodsName.
The cl table fields are GoodsClass, GoodsName, and Goodsu.