I am trying to display data from XML using dataset in gridview. Now I am getting data in table format. I am able to display data from individual tables but not all table data at once and I have 7 tables to display data from.
Here is my code:
protected void Page_Load(object sender, EventArgs e)
{
LoadData();
}
public void LoadData()
{
string filePath = Server.MapPath("~/App_Data/dummy.xml");
DataSet dsData = new DataSet();
FileStream fsReadSchema = new FileStream(filePath, FileMode.Open);
dsData.ReadXml(fsReadSchema);
fsReadSchema.Close();
gv.DataSource = dsData.Tables[4];
gv.DataBind();
}
If I get it correctly – I would combine those seven tables into one – merged, as You know what they contains and what are merging criteria.
Other solution – put seven grids on page and bind each table from dataset individually.