How to add the two different dataset into one dataset and bind the final dataset to the data list.
Hi All,
I have two dataset ds1 and ds2. Dataset ds1 have columns-"id","title" and ds2 have columns "id" and "timediff". I have to add these two dataset into ine and bind it to datalist which has columns "id",'title","timediff".
i merge the two dataset into one with the query
ds1.merge(ds2);
this will create two diff datatable in ds. When i bind it two datalist, it does not bind "timediff".
Mycode is below
The XMl which i convert into ds2
<Auction>
<AuctionTime>
<id>7</id>
<timeDiff>0.12:13:32</timeDiff>
</AuctionTime>
<AuctionTime>
<id>8</id>
<timeDiff>0.3:53:41</timeDiff>
</AuctionTime>
<AuctionTime>
<id>9</id>
<timeDiff>8.1:43:40</timeDiff>
</AuctionTime>
</Auction>
by using
strMyXml = "<Auction><AuctionTime><id>7</id><timeDiff>0.12:13:32</timeDiff></AuctionTime><AuctionTime><id>8</id><timeDiff>0.3:53:41</timeDiff></AuctionTime><AuctionTime><id>9</id><timeDiff>8.1:43:40</timeDiff></AuctionTime></Auction>";
XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(strMyXml);
// //Here the XML is prepared and loaded in XML DOM.
xDoc.Save(Server.MapPath("timeDiff.xml"));
////=====================read XML===========================//
DataSet ds2= new DataSet();
ds2.ReadXml(Server.MapPath("timeDiff.xml"));
ds2.AcceptChanges();
ds1.Merge(ds2);//merge two dataset
//=====================================================//
when i bind ds1 to data list it only bind first datatable not of second.
If anyone have the solution tell me.