2013-02-28 44 views

回答

0
' Merge the XML from your datasets: 
tempXML &= Dataset1.GetXML() 
tempXML &= Dataset2.GetXML() 
' Remove the root tags from the XML I used <FullRecord> for mine 
tempXML = tempXML.Replace("<FullRecord>", "").Replace("</FullRecord>", "") 
' Make a new dataset with the modified XML. Be sure to put root tag back first 
MergedDS = New DataSet 
rdr = New StringReader("<FullRecord>" & tempXML & "</FullRecord>") 
MergedDS.ReadXml(rdr) 

MergedDS將所有的表和相同的命名錶中都會有他們的記錄相結合。我只在相當複雜的數據集上進行了測試(4個和15個表分別有關係和其他限制)。

相關問題